Package net.jini.config

Examples of net.jini.config.Configuration


  private ResourceBundle bundle =
      Util.getResourceBundle(CheckPersistence.class);

  public Object run(String[] args) {
      try {
    Configuration config =
        ConfigurationProvider.getInstance(args);
    return getEntries(config);
      } catch (ConfigurationException e) {
    return Util.getString("configproblem", bundle, e.getMessage());
      } catch (Exception e) {
View Full Code Here


    }

    public void run() throws Exception {
        specifyServices(new Class[] {
            JavaSpace.class});
  Configuration c = getConfig().getConfiguration();
        final Listener listener1 = new Listener(c, true);
        final Listener listener2 = new Listener(c, false);
        final JavaSpace space = (JavaSpace) services[0];
        final Entry aEntry = new UninterestingEntry();
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 addOutriggerLease(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",
                 "outriggerLeasePreparer",
                 ProxyPreparer.class);
    lease = (Lease) p.prepareProxy(lease);
      } catch (ConfigurationException e) {
    throw new TestException("Configuration error", e);
View Full Code Here

     */
    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

     * @exception RemoteException
     *         If an error occured while trying to export this object.
     */
    public NotifyCounter(Entry template, long leaseTime)
            throws RemoteException {
  Configuration c = getConfiguration();
  Exporter exporter = QAConfig.getDefaultExporter();
  if (c instanceof com.sun.jini.qa.harness.QAConfiguration) {
      try {
    exporter = (Exporter) c.getEntry("test",
             "outriggerListenerExporter",
             Exporter.class);
      } catch (ConfigurationException e) {
    throw new RemoteException("Configuration Error", e);
      }
View Full Code Here

    protected Exception testResource(String[] options, String content,
            ClassLoader cl) throws IOException {
        Exception result = null;

        try {
            Configuration conf = ConfigurationProvider.getInstance(options, cl);

            if (!conf.getClass().getName().equals(content)) {
                throw new AssertionError(
                        "ConfigurationProvider.getInstance method"
                        + " returns invalid class");
            }
        } catch (ConfigurationException ce) {
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

  throws Exception
    {
  noneConfiguration = configArgs[0].equals("-");
  this.activationID = activationID;
  try {
      final Configuration config =
    ConfigurationProvider.getInstance(configArgs);
      try {
    memberGroups =
        (String[]) removeDups(
             (Object[]) config.getEntry("com.sun.jini.reggie",
                "initialMemberGroups",
                String[].class,
                memberGroups));
    locatorConstraints =
        (MethodConstraints) config.getEntry("lookupSimulator",
              "locatorConstraints",
              MethodConstraints.class);
      } catch (ConfigurationException e) {
    // ignore exception if running the  none configuration
    if (!noneConfiguration) {
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.