Package net.jini.core.constraint

Examples of net.jini.core.constraint.MethodConstraints


    throw new IllegalArgumentException
                                 ("LookupLocator has been discovered already");
      }
      InvocationConstraints ic = InvocationConstraints.EMPTY;
      if (l instanceof RemoteMethodControl) {
    MethodConstraints mc =
        ((RemoteMethodControl) l).getConstraints();
    if (mc != null) {
        ic = mc.getConstraints(getRegistrarMethod);
    }
      }
      try {
                doUnicastDiscovery(l, ic);
    time = System.currentTimeMillis();//mark the time of discovery
View Full Code Here


        if (!(obj instanceof SmartProxy)) {
        return false;
        }
        RemoteMethodControl oproxy =
        (RemoteMethodControl) ((SmartProxy) obj).remoteProxy;
        MethodConstraints mc = oproxy.getConstraints();
        TrustEquivalence trusted =
        (TrustEquivalence) remoteProxy.setConstraints(mc);
        return trusted.checkTrustEquivalence(oproxy);
    }
View Full Code Here

     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        ProxyTrustVerifier ptv = new ProxyTrustVerifier();
        MethodConstraints emptyMC = new BasicMethodConstraints(
                new BasicMethodConstraints.MethodDesc[] {
                    new BasicMethodConstraints.MethodDesc(
                            "getProxyVerifier",
                            InvocationConstraints.EMPTY) });
        Object[] testObjs = new Object[] {
View Full Code Here

     *         <code>lease</code> is an instance of
     *         <code>ConstrainableFiddlerLease</code>.
     */
    static FiddlerLeaseMap createLeaseMap(FiddlerLease lease, long duration) {
        if(lease instanceof FiddlerLease.ConstrainableFiddlerLease) {
            MethodConstraints leaseConstraints =
        ((FiddlerLease.ConstrainableFiddlerLease)lease).getConstraints();

            return new ConstrainableFiddlerLeaseMap(lease.getServer(),
                                                    lease,
                                                    duration,
View Full Code Here

             */
            if( !(key instanceof FiddlerLease.ConstrainableFiddlerLease) ) {
                return false;
            }//endif
            /* Compare constraints */
            MethodConstraints keyConstraints =
          ((FiddlerLease.ConstrainableFiddlerLease)key).getConstraints();
            return ConstrainableProxyUtil.equivalentConstraints
                                              ( methodConstraints,
                                                keyConstraints,
                                                canContainKeyMethodMapArray );
View Full Code Here

         *  applied to the given client method constraints.
         */
        private static Fiddler constrainServer( Fiddler server,
                                                MethodConstraints constraints )
        {
            MethodConstraints newConstraints
               = ConstrainableProxyUtil.translateConstraints(constraints,
                                                             methodMapArray);
            RemoteMethodControl constrainedServer =
                ((RemoteMethodControl)server).setConstraints(newConstraints);

View Full Code Here

            private static RemoteTestServiceInterface constrainServer
                                      ( RemoteTestServiceInterface innerProxy,
                                        MethodConstraints constraints )
            {
                MethodConstraints newConstraints
                 = ConstrainableProxyUtil.translateConstraints(constraints,
                                                               methodMapArray);
                RemoteMethodControl constrainedServer =
              ((RemoteMethodControl)innerProxy).setConstraints(newConstraints);
View Full Code Here

  // change to set unconditionally
        lookupProxy.setLocator(lookupLocator);

  /* add new configration entries from the davis reggie implementation */
  Configuration config = qaConfig.getConfiguration();
  MethodConstraints discoveryConstraints = null;
  try {
      try {
          multicastInterfaces = (NetworkInterface[]) config.getEntry(
            "test", "multicastInterfaces", NetworkInterface[].class);
          multicastInterfacesSpecified = true;
      } catch (NoSuchEntryException e) {
          List l = Collections.list(NetworkInterface.getNetworkInterfaces());
          multicastInterfaces = (NetworkInterface[])
        l.toArray(new NetworkInterface[l.size()]);
          multicastInterfacesSpecified = false;
      }
//      multicastAnnouncementInterval = Config.getLongEntry(
//          config, "test", "multicastAnnouncementInterval",
//          multicastAnnouncementInterval, 1, Long.MAX_VALUE);
      multicastAnnouncementInterval =
          qaConfig.getLongConfigVal("net.jini.discovery.announce", 120000);
      discoveryConstraints =
          (MethodConstraints) config.getEntry(
        "test", "discoveryConstraints",
        MethodConstraints.class, null);
      if (discoveryConstraints == null) {
          discoveryConstraints =
        new BasicMethodConstraints(InvocationConstraints.EMPTY);
      }
      try {
          multicastRequestSubjectChecker =
        (ClientSubjectChecker) Config.getNonNullEntry(
            config, "test", "multicastRequestSubjectChecker",
            ClientSubjectChecker.class);
      } catch (NoSuchEntryException e) {
          // leave null
      }
      try {
          unicastDiscoverySubjectChecker =
        (ClientSubjectChecker) Config.getNonNullEntry(
            config, "test", "unicastDiscoverySubjectChecker",
            ClientSubjectChecker.class);
      } catch (NoSuchEntryException e) {
          // leave null
      }
  } catch (ConfigurationException ce) {
      throw new RuntimeException("Configuration error", ce);
  }
  protocol2 = Discovery.getProtocol2(null);
  multicastRequestConstraints = DiscoveryConstraints.process(
      discoveryConstraints.getConstraints(
    DiscoveryConstraints.multicastRequestMethod));
  multicastAnnouncementConstraints = DiscoveryConstraints.process(
      discoveryConstraints.getConstraints(
    DiscoveryConstraints.multicastAnnouncementMethod));
  unicastDiscoveryConstraints = DiscoveryConstraints.process(
      discoveryConstraints.getConstraints(
    DiscoveryConstraints.unicastDiscoveryMethod));

  try {
            DEFAULT_MULTICAST_TTL = Config.getIntEntry(
          config, "multicast", "ttl", 1, 0, 15);
View Full Code Here

                                                    (COMPONENT_NAME,
                                                     "registrarPreparer",
                                                     ProxyPreparer.class,
                                                     new BasicProxyPreparer());
  /* constraints */
  MethodConstraints constraints = (MethodConstraints)config.getEntry
                (COMPONENT_NAME,
                 "discoveryConstraints",
                 MethodConstraints.class,
                 null);
  if (constraints == null) {
      constraints =
    new BasicMethodConstraints(InvocationConstraints.EMPTY);
  }
  multicastRequestConstraints = DiscoveryConstraints.process(
      constraints.getConstraints(
    DiscoveryConstraints.multicastRequestMethod));
  multicastAnnouncementConstraints = DiscoveryConstraints.process(
      constraints.getConstraints(
    DiscoveryConstraints.multicastAnnouncementMethod));
  rawUnicastDiscoveryConstraints =
      constraints.getConstraints(
    DiscoveryConstraints.unicastDiscoveryMethod);

        /* Task manager */
        try {
            taskManager = (TaskManager)config.getEntry(COMPONENT_NAME,
View Full Code Here

  // Same landlord, check to see if we have comparable constraints.
  if (!(key instanceof ConstrainableLandlordLease))
      return false;

  // The key's constraints
  final MethodConstraints lmc =
      ((ConstrainableLandlordLease)key).getConstraints();

  // Our constraints
  final MethodConstraints omc =
      ((RemoteMethodControl)landlord()).getConstraints();

  // Are they equivalent (after applying the map)?
  return ConstrainableProxyUtil.equivalentConstraints(
      lmc, omc, ConstrainableLandlordLease.leaseMapMethodMapArray);
View Full Code Here

TOP

Related Classes of net.jini.core.constraint.MethodConstraints

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.