Examples of InvocationConstraints


Examples of net.jini.core.constraint.InvocationConstraints

  public boolean tryGetProxy() {
      if (proxy != null ) {
    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);
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

     * processed
     */
    public ServiceRegistrar getRegistrar(int timeout)
  throws IOException, ClassNotFoundException
    {
  InvocationConstraints ic = (constraints != null) ?
      constraints.getConstraints(getRegistrarTimeoutMethod) :
      InvocationConstraints.EMPTY;
  Collection reqs = new ArrayList(ic.requirements());
  reqs.add(new UnicastSocketTimeout(timeout));
  return getRegistrar(new InvocationConstraints(reqs, ic.preferences()));
    }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

          InvocationConstraints constraints)
    {
  if (maxPacketSize < MIN_MAX_PACKET_SIZE) {
      throw new IllegalArgumentException("maxPacketSize too small");
  }
  final InvocationConstraints absc =
      (constraints != null) ? constraints.makeAbsolute() : null;

  return new EncodeIterator() {

      private final Iterator entries =
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

              InvocationConstraints constraints)
    {
  if (maxPacketSize < MIN_MAX_PACKET_SIZE) {
      throw new IllegalArgumentException("maxPacketSize too small");
  }
  final InvocationConstraints absc =
      (constraints != null) ? constraints.makeAbsolute() : null;

  return new EncodeIterator() {

      private final Iterator entries =
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

  public boolean tryGetProxy() {
      if (proxy != null ) {
    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);
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

     */
    private static void checkConstraints(ServerCapabilities serverCapabilities,
           InvocationConstraints constraints)
  throws UnsupportedConstraintException
    {
  InvocationConstraints unfulfilled =
      serverCapabilities.checkConstraints(constraints);
  for (Iterator i = unfulfilled.requirements().iterator(); i.hasNext();)
  {
      InvocationConstraint c = (InvocationConstraint) i.next();
      if (!(c instanceof Integrity)) {
    throw new UnsupportedConstraintException(
        "cannot satisfy unfulfilled constraint: " + c);
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

      /*
       * Unmarshal method and check security constraints.
       */
      in = createMarshalInputStream(impl, request, integrity, context);
      method = unmarshalMethod(impl, in, context);
      InvocationConstraints sc =
    (serverConstraints == null ?
     InvocationConstraints.EMPTY :
     serverConstraints.getConstraints(method));
      if (integrity && !sc.requirements().contains(Integrity.YES)) {
    Collection requirements = new ArrayList(sc.requirements());
    requirements.add(Integrity.YES);
    sc = new InvocationConstraints(requirements, sc.preferences());
      }
     
      InvocationConstraints unfulfilled = request.checkConstraints(sc);
      for (Iterator i = unfulfilled.requirements().iterator();
     i.hasNext();)
      {
    InvocationConstraint c = (InvocationConstraint) i.next();
    if (!(c instanceof Integrity) ||
        (!integrity && c == Integrity.YES))
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

           
            // 1
            String name = "someMethod";
            Class[] types = new Class[] {int.class, Object.class};
            InvocationConstraint ic = Delegation.YES;
            InvocationConstraints constraints = new InvocationConstraints(
                    ic, null);
            MethodDesc md = callConstructor(testCase, name, types, constraints);
            String result = md.toString();
            if (result.length() == 0) {
                throw new TestException(
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

              Method method,
              Object[] args)
  throws Throwable
    {
  Util.checkProxyRemoteMethod(proxy.getClass(), method);
  InvocationConstraints constraints = getConstraints(method);

  if (logger.isLoggable(Level.FINE)) {
      logCall(method, args, constraints);
  }
View Full Code Here

Examples of net.jini.core.constraint.InvocationConstraints

       * requirements include Integrity.YES, then we must verify
       * codebase integrity at this level.  If there are any
       * non-Integrity unfulfilled requirements, we cannot
       * satisfy them, so this request attempt must fail.
       */
      InvocationConstraints unfulfilled =
    request.getUnfulfilledConstraints();
      for (Iterator i = unfulfilled.requirements().iterator();
     i.hasNext();)
      {
    InvocationConstraint c = (InvocationConstraint) i.next();
    if (c == Integrity.YES) {
        integrity = true;
    } else if (!(c instanceof Integrity)) {
        throw new UnsupportedConstraintException(
      "cannot satisfy unfulfilled constraint: " + c);
    }
    // REMIND: support ConstraintAlternatives containing Integrity?
      }

      /*
       * Even if Integrity.YES wasn't a requirement, we will
       * satisfy a preference for it.
       */
      if (!integrity) {
    for (Iterator i = unfulfilled.preferences().iterator();
         i.hasNext();)
    {
        InvocationConstraint c = (InvocationConstraint) i.next();
        if (c == Integrity.YES) {
      integrity = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.