Package net.jini.core.constraint

Examples of net.jini.core.constraint.MethodConstraints


                                                    (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


   * If underlying proxy's constraints are non-null,
   * set underlying proxy to a copy of the underlying
   * proxy with null constraints.
   */
  if (uproxy instanceof RemoteMethodControl) {
      MethodConstraints uproxyConstraints =
    ((RemoteMethodControl) uproxy).getConstraints();
      if (uproxyConstraints != null) {
    uproxy = (Remote) ((RemoteMethodControl) uproxy).
        setConstraints(null);
      }
View Full Code Here

     * constraints of this invocation handler, or if the underlying proxy
     * does not implement RemoteMethodControl.
     */
    private boolean hasConsistentConstraints() {
  if (uproxy instanceof RemoteMethodControl) {
      MethodConstraints uproxyConstraints =
    ((RemoteMethodControl) uproxy).getConstraints();
      return (clientConstraints == null ?
        uproxyConstraints == null :
        clientConstraints.equals(uproxyConstraints));
  } else {
View Full Code Here

      }
      Remote newProxy;
      synchronized (this) {
    newProxy = uproxy;
      }
      MethodConstraints mc = (MethodConstraints) args[0];
      if (newProxy instanceof RemoteMethodControl) {
    newProxy = (Remote)
        ((RemoteMethodControl) newProxy).setConstraints(mc);
      }
      Class proxyClass = proxy.getClass();
View Full Code Here

  /*
   * Make the relative constraints (if any) on the method absolute.
   * If there are relative constraints, create new method constraints
   * to set on the underlying proxy before invoking a method.
   */
  MethodConstraints convertedConstraints = null;
  if (clientConstraints != null) {
      InvocationConstraints relativeConstraints =
    clientConstraints.getConstraints(method);
      InvocationConstraints absoluteConstraints =
    relativeConstraints.makeAbsolute();
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

     *         does not implement <code>RemoteMethodControl</code>.
     */
    private static Landlord constrainServer(Landlord server,
  MethodConstraints constraints, Method[] mapping)
    {
  final MethodConstraints serverRefConstraints
      = ConstrainableProxyUtil.translateConstraints(constraints,
                mapping);
  final RemoteMethodControl constrainedServer =
      ((RemoteMethodControl)server).
      setConstraints(serverRefConstraints);
View Full Code Here

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

  final MethodConstraints lmc =
      ((ConstrainableLandlordLease)lease).methodConstraints;
 
  return
      ConstrainableProxyUtil.equivalentConstraints(
    methodConstraints, lmc, comparableMethodsMapArray);
View Full Code Here

  if ((inputProxyID != null) &&
      !(proxyID.equals(inputProxyID))) {
      return false;
  }

  MethodConstraints mc = otherServerProxy.getConstraints();
  TrustEquivalence trusted =
      (TrustEquivalence) serverProxy.setConstraints(mc);
  boolean result = trusted.checkTrustEquivalence(otherServerProxy);
  if (logger.isLoggable(Level.FINER)) {
      logger.exiting(ProxyVerifier.class.getName(), "isTrustedObject",
View Full Code Here

    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

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.