Package net.jini.config

Examples of net.jini.config.Configuration


     */
    public void addMahaloLease(Lease lease, boolean unknownOk)
  throws TestException
    {
  ProxyPreparer p = null;
  Configuration c = getConfig().getConfiguration();
  if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
      try {
    p = (ProxyPreparer) c.getEntry("test",
                 "mahaloLeasePreparer",
                 ProxyPreparer.class);
    lease = (Lease) p.prepareProxy(lease);
      } catch (ConfigurationException e) {
    throw new TestException("Configuration error", e);
View Full Code Here


        this.memberGroups = memberGroups;
        this.unicastPort  = unicastPort;
        // start LUS before switching identity to reggie
        lookupProxy = (LookupSimulatorProxyInterface) manager.startLookupService();
  LoginContext context = null;
  Configuration c = config.getConfiguration();
  try {
      context = (LoginContext) c.getEntry("test",
            "reggieLoginContext",
            LoginContext.class,
            null);
  } catch (ConfigurationException e) {
      throw new RuntimeException("Bad configuration", e);
  }
  if (context == null) {
    init(config);
        } else {
      try {
    Principal reggie =
        (Principal) c.getEntry("principal", "reggie", Principal.class);
    // allow the simulator, running as reggie, to authenticate as reggie
    // XXX Should the permission be obtained from the configuration???
    Security.grant(lookupProxy.getClass(),
             new Principal[]{reggie},
             new Permission[] {
View Full Code Here

//          }//endif
  // 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);
View Full Code Here

     */
    public void run() throws Exception {
        logger.log(Level.INFO, "---------------------------");
        ClassLoader defaultCL =
                Thread.currentThread().getContextClassLoader();
        Configuration conf;

        // 1
        Exception result = testResource(null,
                ValidConfiguration.class.getName());

View Full Code Here

    /**
     * This method performs all actions mentioned in class description.
     */
    public void run() throws Exception {
        Configuration conf;

        // actions step 1
        try {
            conf = ConfigurationProvider.getInstance(null);

View Full Code Here

    {
  if (state != UNUSED) {
      throw new ActivationException("group previously created");
  }
  try {
      final Configuration config = getConfiguration(desc.getData());
      login = (LoginContext) config.getEntry(
      PHOENIX, "loginContext", LoginContext.class, null);
      if (login != null) {
    login.login();
      }
   
      inheritGroupSubject =
    ((Boolean) config.getEntry(
        PHOENIX, "inheritGroupSubject", boolean.class,
        Boolean.FALSE)).booleanValue();
     
      return (java.rmi.activation.ActivationGroup) doAction(
    new PrivilegedExceptionAction() {
        public Object run() throws Exception {
      ProxyPreparer sysPreparer =
          getPreparer(config, "systemPreparer");
      monPreparer = getPreparer(config,
              "monitorPreparer");
      TcpServerEndpoint se =
          TcpServerEndpoint.getInstance(0);
      Exporter defaultExporter =
          new BasicJeriExporter(se, new AccessILFactory());
      exporter = (Exporter) config.getEntry(
        PHOENIX, "instantiatorExporter",
        Exporter.class, defaultExporter);
      if (exporter == null) {
          exporter = new AlreadyExportedExporter();
      }
View Full Code Here

    {
       if (operationsLogger.isLoggable(Level.FINER)) {
      operationsLogger.entering(mailboxSourceClass,
          "init", (Object[])configArgs);
       }
       final Configuration config =
            ConfigurationProvider.getInstance(
          configArgs, getClass().getClassLoader());
        loginContext = (LoginContext) config.getEntry(
            MERCURY, "loginContext", LoginContext.class, null);
        if (loginContext != null) {
            doInitWithLogin(config, loginContext);
        } else {
            doInit(config);
View Full Code Here

    static Activation main(final String[] configOptions,
         final boolean stop,
         final PhoenixStarter starter)
  throws Exception
    {
  final Configuration config = getConfig(configOptions, starter);
  final LoginContext login =
      (LoginContext) config.getEntry(PHOENIX, "loginContext",
             LoginContext.class, null);
  if (login != null) {
      login.login();
  }
  PrivilegedExceptionAction action = new PrivilegedExceptionAction() {
      public Object run() throws Exception {
    if (stop) {
        assert starter == null;
        shutdown(config);
        System.exit(0);
    }
    String logName = null;
    try {
        logName = (String) config.getEntry(
      PHOENIX, "persistenceDirectory", String.class);
    } catch (NoSuchEntryException e) {
        if (starter == null) {
      bomb("phoenix.missing.log", null);
        } else {
View Full Code Here

              locatorsToDiscover,
              listener,
              mHandback,
              leaseDuration)
      logger.log(Level.FINEST, "Preparing fiddler registration");
      Configuration c = config.getConfiguration();
      ProxyPreparer p = new BasicProxyPreparer();
      if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
      p = (ProxyPreparer) c.getEntry("test",
                 "fiddlerRegistrationPreparer",
                 ProxyPreparer.class);
      }
      registrationMap.put(p.prepareProxy(ldsReg),listener);
  } catch (ConfigurationException e) {
View Full Code Here

     * @return the prepared lease
     */
    protected Lease getPreparedLease(LookupDiscoveryRegistration reg)
  throws RemoteException
    {
  Configuration c = config.getConfiguration();
  if (!(c instanceof com.sun.jini.qa.harness.QAConfiguration)) { // if none configuration
      return reg.getLease();
  }
  try {
      ProxyPreparer p = (ProxyPreparer) c.getEntry("test",
               "fiddlerLeasePreparer",
               ProxyPreparer.class);
      Lease l = reg.getLease();
      logger.log(Level.FINEST, "Returning prepared fiddler lease");
      return (Lease) p.prepareProxy(l);
View Full Code Here

TOP

Related Classes of net.jini.config.Configuration

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.