Package net.jini.security

Examples of net.jini.security.ProxyPreparer


     */
    protected Object doProxyPreparation(Object proxy) throws TestException {
  String[] entryTokens = config.splitKey(preparerName);
  if (entryTokens != null) {
      try {
    ProxyPreparer p;
    Configuration c = config.getConfiguration();
    if (!(c instanceof QAConfiguration)) { // the 'none' configuration
        return proxy;
    }
    p = (ProxyPreparer)
        c.getEntry(entryTokens[0],
             entryTokens[1],
             ProxyPreparer.class,
             null);
    if (p == null) {
        throw new TestException("No preparer found for entry "
              + preparerName);
    }
    proxy = p.prepareProxy(proxy);
      } catch (ConfigurationException e) {
    throw new TestException("Configuration problem", e);
      } catch (RemoteException e) {
    throw new TestException("Remote Exception preparing proxy", e);
      }
View Full Code Here


      throw new TestException("Could not get service's "
          + "Administrable interface");
  }

        Configuration serviceConf = getConfig().getConfiguration();
  ProxyPreparer preparer = new BasicProxyPreparer();
  if (serviceConf instanceof com.sun.jini.qa.harness.QAConfiguration) {
      preparer =
    (ProxyPreparer) serviceConf.getEntry("test",
                 "mahaloAdminPreparer",
                 ProxyPreparer.class);
  }
  admin = preparer.prepareProxy(admin);
  return admin;
   
View Full Code Here

  if (mr == null) {
      throw new TestException("Created argument cannot be null");
  }

        Configuration serviceConf = getConfig().getConfiguration();
  ProxyPreparer preparer = new BasicProxyPreparer();
  if (serviceConf instanceof com.sun.jini.qa.harness.QAConfiguration) {
      preparer =
    (ProxyPreparer) serviceConf.getEntry("test",
                 "mahaloLeasePreparer",
                 ProxyPreparer.class);
  }
  Lease proxy = (Lease) preparer.prepareProxy(mr.lease);
  return proxy;
   
View Full Code Here

  if (l != null) {
      Configuration c = getConfig().getConfiguration();
      if (!(c instanceof com.sun.jini.qa.harness.QAConfiguration)) { // none configuration
    return l;
      }
      ProxyPreparer p = (ProxyPreparer)
                  c.getEntry("test",
           "outriggerLeasePreparer",
           ProxyPreparer.class);
      if (p != null) {
    l = (Lease) p.prepareProxy(l);
      }
  }
  return l;
    }
View Full Code Here

  if (reg != null) {
      Configuration c = getConfig().getConfiguration();
      if (!(c instanceof com.sun.jini.qa.harness.QAConfiguration)) { // none configuration
    return reg;
      }
      ProxyPreparer p = (ProxyPreparer)
                  c.getEntry("test",
           "outriggerEventRegistrationPreparer",
           ProxyPreparer.class);
      if (p != null) {
    reg = (EventRegistration) p.prepareProxy(reg);
      }
  }
  return reg;
    }
View Full Code Here

                if(context == null)
                    throw new IllegalArgumentException("context is null");
                ServiceAdvertiser.advertise(sbProxy, context, false);

                try {
                    ProxyPreparer prep = (ProxyPreparer)context.getConfiguration().getEntry(BOOT_COMPONENT,
                                                                                            "adminProxyPreparer",
                                                                                            BasicProxyPreparer.class,
                                                                                            new BasicProxyPreparer());
                    Object preparedPProxy = prep.prepareProxy(sbProxy);
                    if(preparedPProxy instanceof Administrable) {
                        Administrable admin = (Administrable)preparedPProxy;
                        Object adminObject = admin.getAdmin();
                        if(adminObject instanceof DestroyAdmin) {
                            Subject subject = null;
View Full Code Here

        Map<String, Object> configParameters = sc.getConfigurationParameters();

        String[] args = (String[])configParameters.get(ServiceBeanConfig.SERVICE_PROVISION_CONFIG);
        MethodConstraints serviceListenerConstraints=
                new BasicMethodConstraints(new InvocationConstraints(new ConnectionRelativeTime(30000), null));
        ProxyPreparer defaultProxyPreparer =  new BasicProxyPreparer(false, serviceListenerConstraints, null);

        if(args==null) {
            proxyPreparer = defaultProxyPreparer;
        } else {
            /* Service specific provisioning config */
 
View Full Code Here

        if(logger.isTraceEnabled())
            ClassLoaderUtil.displayClassLoaderTree(serviceCL);
       
        currentThread.setContextClassLoader(serviceCL);
        /* Get the ProxyPreparer */
        ProxyPreparer servicePreparer = (ProxyPreparer)Config.getNonNullEntry(config,
                                                                              COMPONENT,
                                                                              "servicePreparer",
                                                                              ProxyPreparer.class,
                                                                              new BasicProxyPreparer());
        synchronized(RioServiceDescriptor.class) {
            /* supplant global policy 1st time through */
            if(globalPolicy == null) {
                //initialGlobalPolicy = Policy.getPolicy();
                initialGlobalPolicy = new PolicyFileProvider(getPolicy());
                globalPolicy = new AggregatePolicyProvider(initialGlobalPolicy);
                Policy.setPolicy(globalPolicy);
                if(logger.isTraceEnabled())
                    logger.trace("Global policy set: {}", globalPolicy.toString());
            }
            /*DynamicPolicyProvider service_policy = new DynamicPolicyProvider(new PolicyFileProvider(getPolicy()));
            LoaderSplitPolicyProvider splitServicePolicy =
                new LoaderSplitPolicyProvider(serviceCL, service_policy, new DynamicPolicyProvider(initialGlobalPolicy));
            globalPolicy.setPolicy(serviceCL, splitServicePolicy);*/
        }
        Object impl;
        try {
            Class<?> implClass;
            implClass = Class.forName(getImplClassName(), false, serviceCL);
            if(logger.isTraceEnabled())
                logger.trace("Attempting to get implementation constructor");
            Constructor constructor = implClass.getDeclaredConstructor(actTypes);
            if(logger.isTraceEnabled())
                logger.trace("Obtained implementation constructor: {}", constructor.toString());
            constructor.setAccessible(true);
            impl = constructor.newInstance(getServerConfigArgs(), lifeCycle);
            if(logger.isTraceEnabled())
                logger.trace("Obtained implementation instance: {}", impl.toString());
            if(impl instanceof ServiceProxyAccessor) {
                proxy = ((ServiceProxyAccessor)impl).getServiceProxy();
            } else if(impl instanceof ProxyAccessor) {
                proxy = ((ProxyAccessor)impl).getProxy();
            } else {
                proxy = null; // just for insurance
            }
            if(proxy != null) {
                proxy = servicePreparer.prepareProxy(proxy);
            }
            if(logger.isTraceEnabled())
                logger.trace("Proxy:  {}", proxy==null?"<NULL>":proxy.toString());
            currentThread.setContextClassLoader(currentClassLoader);
        } catch(InvocationTargetException e) {
View Full Code Here

            /* Get the ProxyPreparer */
            if(logger.isTraceEnabled()) {
                logger.trace("Get the ProxyPreparer for {}", ServiceLogUtil.logName(sElem));
            }
           
            ProxyPreparer servicePreparer = (ProxyPreparer)Config.getNonNullEntry(context.getConfiguration(),
                                                                                  CONFIG_COMPONENT,
                                                                                  "servicePreparer",
                                                                                  ProxyPreparer.class,
                                                                                  new BasicProxyPreparer());
            if(logger.isTraceEnabled()) {
                logger.trace("Getting the proxy");
            }
            Object proxy = created.getProxy();
            if(logger.isTraceEnabled()) {
                logger.trace("Obtained the proxy %s", proxy);
            }
            if(proxy != null) {
                proxy = servicePreparer.prepareProxy(proxy);
            }
            if(logger.isTraceEnabled()) {
                logger.trace("Proxy {}, prepared? {}", proxy, (proxy==null?"not prepared, returned proxy was null": "yes"));
            }
            /*
 
View Full Code Here

     */                                 
    public BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener listener,
                              final MarshalledObject handback,
                              final Configuration config) throws Exception {
        ProxyPreparer basicLeasePreparer = new BasicProxyPreparer();


        if(config == null)
            this.config = EmptyConfiguration.INSTANCE;
        else
View Full Code Here

TOP

Related Classes of net.jini.security.ProxyPreparer

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.