Package net.jini.core.constraint

Examples of net.jini.core.constraint.RemoteMethodControl


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

            return ((TxnManager)constrainedServer);
        }//end constrainServer
View Full Code Here


      throw new NullPointerException("Arguments must not be null");
  } else if (obj instanceof ConstrainableLandlordLease) {
      return new LandlordProxyVerifier(
    (Landlord) serverProxy, serverUuid).isTrustedObject(obj, ctx);
  }
  RemoteMethodControl otherServerProxy;
  if (obj instanceof SetProxy.ConstrainableSetProxy) {
      if (!isTrustedObject(((SetProxy) obj).getRenewalSetLease(), ctx)) {
    return false;
      }
      otherServerProxy =
    (RemoteMethodControl) ((AbstractProxy) obj).server;
  } else if (obj instanceof AdminProxy.ConstrainableAdminProxy ||
       obj instanceof NormProxy.ConstrainableNormProxy)
  {
      if (!serverUuid.equals(((AbstractProxy) obj).uuid)) {
    return false;
      }
      otherServerProxy =
    (RemoteMethodControl) ((AbstractProxy) obj).server;
  } else if (obj instanceof RemoteMethodControl) {
      otherServerProxy = (RemoteMethodControl) obj;
  } else {
      return false;
  }
  MethodConstraints mc = otherServerProxy.getConstraints();
  TrustEquivalence trusted =
      (TrustEquivalence) serverProxy.setConstraints(mc);
  return trusted.checkTrustEquivalence(otherServerProxy);
    }
View Full Code Here

          new Object[] { obj, ctx });
  }
  if (obj == null || ctx == null) {
      throw new NullPointerException("Arguments must not be null");
  }
  RemoteMethodControl otherServerProxy;
  Uuid inputProxyID = null;
  if (obj instanceof TxnMgrProxy.ConstrainableTxnMgrProxy) {
      otherServerProxy = (RemoteMethodControl)
    ((TxnMgrProxy)obj).backend;
      inputProxyID = ((ReferentUuid)obj).getReferentUuid();
  } else if (obj instanceof ConstrainableLandlordLease) {
      final LandlordProxyVerifier lpv =
    new LandlordProxyVerifier((Landlord)serverProxy, proxyID);
      return lpv.isTrustedObject(obj, ctx);
  } else if (
      obj instanceof TxnMgrAdminProxy.ConstrainableTxnMgrAdminProxy) {
      otherServerProxy = (RemoteMethodControl)
    ((TxnMgrAdminProxy)obj).server;
      inputProxyID = ((ReferentUuid)obj).getReferentUuid();
  } else if (obj instanceof TxnManager &&
             obj instanceof RemoteMethodControl) {
      otherServerProxy = (RemoteMethodControl)obj;
      inputProxyID = proxyID;
  } else {
      logger.log(Level.FINEST, "Object {0} is not a supported type",
    obj);
      return false;
  }

  // For top-level proxies, quickly verify proxy Uuid
  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

    /**
     * A passthrough call to the underlying <code>RemoteMethodControl</code> stub
     */
    public RemoteMethodControl setConstraints(MethodConstraints constraints) {
    RemoteMethodControl newStub = ((RemoteMethodControl) remoteProxy).
                                         setConstraints(constraints);
    return new SmartProxy((ConstraintsInterface) newStub, coordinator);
    }
View Full Code Here

        throws RemoteException
    {
        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

                                                MethodConstraints constraints )
        {
            MethodConstraints newConstraints
               = ConstrainableProxyUtil.translateConstraints(constraints,
                                                             methodMapArray);
            RemoteMethodControl constrainedServer =
                ((RemoteMethodControl)server).setConstraints(newConstraints);

            return ((Fiddler)constrainedServer);
        }//end constrainServer
View Full Code Here

                                        MethodConstraints constraints )
            {
                MethodConstraints newConstraints
                 = ConstrainableProxyUtil.translateConstraints(constraints,
                                                               methodMapArray);
                RemoteMethodControl constrainedServer =
              ((RemoteMethodControl)innerProxy).setConstraints(newConstraints);

                return ((RemoteTestServiceInterface)constrainedServer);
            }//end constrainServer
View Full Code Here

  throws RemoteException
    {
  if (obj == null || ctx == null) {
      throw new NullPointerException();
  }
  RemoteMethodControl inputServer;
  if (obj instanceof TesterTransactionManagerConstrainableProxy) {
      inputServer = (RemoteMethodControl) ((TesterTransactionManagerProxy) obj).server;
  } else {
      return false;
  }

  TrustEquivalence trustEquiv = (TrustEquivalence)
      server.setConstraints(inputServer.getConstraints());
  return trustEquiv.checkTrustEquivalence(inputServer);
    }
View Full Code Here

  MethodConstraints constraints, Method[] mapping)
    {
  final MethodConstraints serverRefConstraints
      = ConstrainableProxyUtil.translateConstraints(constraints,
                mapping);
  final RemoteMethodControl constrainedServer =
      ((RemoteMethodControl)server).
      setConstraints(serverRefConstraints);

  return (Landlord)constrainedServer;
    }
View Full Code Here

         * handle are:
         *  - ConstrainableLandlordLease
         */

  // Server reference from input proxy
        final RemoteMethodControl inputProxyServer;
        if (obj instanceof ConstrainableLandlordLease) {
      final ConstrainableLandlordLease cll =
    (ConstrainableLandlordLease)obj;

      // Check the landlordUuid of obj
      if (!landlordUuid.equals(cll.landlordUuid()))
    return false;

      // Extract the landlord ref
            inputProxyServer = (RemoteMethodControl)cll.landlord();
        } else {
      // A proxy type we don't know about
            return false;
        }

        /* Get the client constraints currently set on the server reference
   * of contained in the input proxy
   */
        final MethodConstraints mConstraints =
      inputProxyServer.getConstraints();

        /* Create a copy of the canonical server reference with its method
   * constraints replaced with the method constraints on
   * server reference of the input proxy.
         */
 
View Full Code Here

TOP

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

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.