Package net.jini.config

Examples of net.jini.config.ConfigurationException


                String[] groups0 =
                           ((DiscoveryGroupManagement)joinMgrLDM).getGroups();
                if(    (groups0 == DiscoveryGroupManagement.ALL_GROUPS)
                    || (groups0.length != 0) )
                {
                    throw new ConfigurationException
                                 ("discoveryManager entry must be configured "
                                  +"to initially discover/join NO_GROUPS");
                }//endif
            } else {// !(joinMgrLDM instanceof DiscoveryGroupManagement)
                throw new ConfigurationException
                                       ("discoveryManager entry must "
                                        +"implement DiscoveryGroupManagement");
            }//endif
            if( joinMgrLDM instanceof DiscoveryLocatorManagement ) {
                LookupLocator[] locs0 =
                        ((DiscoveryLocatorManagement)joinMgrLDM).getLocators();
                if( (locs0 != null) && (locs0.length != 0) ) {
                    throw new ConfigurationException
                                 ("discoveryManager entry must be configured "
                                  +"to initially discover/join no locators");
                }//endif
            } else {// !(joinMgrLDM instanceof DiscoveryLocatorManagement)
                throw new ConfigurationException
                                     ("discoveryManager entry must "
                                      +"implement DiscoveryLocatorManagement");
            }//endif
        } catch (NoSuchEntryException e) {
            joinMgrLDM
View Full Code Here


        }
        conf.setException(null);

        // 12
        final Throwable[] exceptionList2 = {
              new ConfigurationException(""),
              new ConfigurationNotFoundException(""),
              new NoSuchEntryException(""),
              new Error() };
        for (int e = 0; e < exceptionList2.length; ++e) {
            Throwable testException = exceptionList2[e];
View Full Code Here

                String[] groups =
                    ((DiscoveryGroupManagement)lookupDiscMgr).getGroups();
                if( (groups == DiscoveryGroupManagement.ALL_GROUPS) ||
                    (groups.length != 0) )
                {
                    throw new ConfigurationException(
                        "discoveryManager entry must be configured " +
            " with no groups.");
                }//endif
      } else {
               throw new ConfigurationException(
                    "discoveryManager entry must implement " +
                    "DiscoveryGroupManagement");
            }
     
            if(lookupDiscMgr instanceof DiscoveryLocatorManagement) {
                LookupLocator[] locs =
                        ((DiscoveryLocatorManagement)lookupDiscMgr).getLocators();
                if( (locs != null) && (locs.length != 0) ) {
                    throw new ConfigurationException(
                        "discoveryManager entry must be configured " +
            "with no locators");
                }//endif
      } else {
                throw new ConfigurationException(
                    "discoveryManager entry must implement " +
                    "DiscoveryLocatorManagement");
           
     
      ((DiscoveryGroupManagement)lookupDiscMgr).setGroups(lookupGroups);
View Full Code Here

     */
    private static ConfigurationException throwNewConfigurationException(
            String msg)
  throws ConfigurationException
    {
  final ConfigurationException e = new ConfigurationException(msg);

  if (logger.isLoggable(Levels.FAILED)) {
      logger.log(Levels.FAILED, msg, e);
  }

View Full Code Here

                                      (COMPONENT_NAME,
                                       "maxLeaseDuration",
                                       long.class,
                                       new Long(renewalDuration))).longValue();
        if( (renewalDuration == 0) || (renewalDuration < Lease.ANY) ) {
            throw new ConfigurationException("invalid configuration entry: "
                                             +"renewalDuration ("
                                             +renewalDuration+") must be "
                                             +"positive or Lease.ANY");
        }//endif
  this.callback = callback;
View Full Code Here

      recoverTxns();
  } else if (activationID != null || persistent) {
      /* else we don't have a store, if we need one complain
       * will be logged by constructor
       */
      throw new ConfigurationException("Must provide for a " +
          "store for component " + COMPONENT_NAME + ", by providing " +
    "valid values for the store or " +
          PERSISTENCE_DIR_CONFIG_ENTRY + " entries if creating " +
    " a persistent space");
  }
View Full Code Here

        if(ndx != -1) {
            String portString = heartbeatServer.substring(ndx + 1);
            heartbeatServer = heartbeatServer.substring(0, ndx);
            port = Integer.parseInt(portString);
        } else {
            throw new ConfigurationException("heartbeatServer wrong format, no port");
        }
        long heartbeatPeriod = Config.getLongEntry(config,
                                                   COMPONENT,
                                                   HEARTBEAT_PERIOD_KEY,
                                                   DEFAULT_HEARTBEAT_PERIOD,
                                                   0,
                                                   Long.MAX_VALUE);
       
        if(logger.isTraceEnabled()) {
            StringBuilder buffer = new StringBuilder();
            buffer.append("HeartbeatClient Properties : ");
            buffer.append("heartbeatPeriod=").append(heartbeatPeriod).append(", ");
            buffer.append("heartbeatServer=").append(heartbeatServer).append(", ");
            buffer.append("port=").append(port);
            logger.trace(buffer.toString());
        }
        try {
            InetAddress address = InetAddress.getByName(heartbeatServer);
            taskTimer.scheduleAtFixedRate(new HeartbeatTask(address, port),
                                          1000,
                                          heartbeatPeriod);
        } catch(UnknownHostException e) {
            throw new ConfigurationException("heartbeatServer "+
                                             "["+heartbeatServer+"] Unknown host",
                                             e);
        }
    }
View Full Code Here

            ClassLoader cCL = Thread.currentThread().getContextClassLoader();
            String[] args;
            try {
                args = ConfigHelper.getConfigArgs(sElem, cCL);
            } catch (IllegalArgumentException e) {
                throw new ConfigurationException("Could not create configuration, bad arguments " +
                                                 "["+Arrays.toString(sElem.getServiceBeanConfig().getConfigArgs())+"]",
                                                 e);
            } catch (IOException e) {
                throw new ConfigurationException("Could not create configuration", e);
            }
            if(logger.isDebugEnabled()) {
                StringBuilder sb = new StringBuilder();
                for(String s : args) {
                    if(sb.length()>0)
View Full Code Here

        String defaultDescription = address.getHostName()+" "+system;
        description = (String)config.getEntry(COMPONENT, "description", String.class, defaultDescription);
        reportInterval = (Long)config.getEntry(COMPONENT, "reportInterval", Long.class, DEFAULT_REPORT_INTERVAL);
        if(reportInterval<1000)
            throw new ConfigurationException("The reportInterval must not be less then 1000 milliseconds.");
        scheduleResourceCapabilityReporting();
    }
View Full Code Here

                return new Primitive(entry.value);
            } else {
                return entry.value;
            }
        }
        throw new ConfigurationException("Entry of wrong type for "
                                         + "component [" + component + "], name [" + name + "]:"
                                         + "expected [" + type + ", found [" + entry.type + "]");
    }
View Full Code Here

TOP

Related Classes of net.jini.config.ConfigurationException

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.