Package net.jini.config

Examples of net.jini.config.Configuration


    public static void main(String[] args) {
  ServiceStarter.ensureSecurityManager();
        logger.entering(DestroySharedGroup.class.getName(), "main",
      ((Object[])args));
  try {
            Configuration config = ConfigurationProvider.getInstance(args);
            ServiceDescriptor[] srvArray =
                (ServiceDescriptor[])config.getEntry(
                    ServiceStarter.START_PACKAGE, "serviceDestructors",
                    ServiceDescriptor[].class, null);
            if (srvArray == null || srvArray.length == 0) {
                logger.log(Level.WARNING, "service.config.empty");
                return;
            }
            LoginContext loginContext =  (LoginContext)
                config.getEntry(ServiceStarter.START_PACKAGE, "loginContext",
                    LoginContext.class, null);
            if (loginContext != null)
                destroyWithLogin(srvArray, config, loginContext);
            else
                destroy(srvArray, config);
View Full Code Here


  this.lifeCycle = lifeCycle;
  this.activationID = activationID;
  this.serverGate = wrapper;

  try {
      final Configuration config =
    ConfigurationProvider.getInstance(configArgs,
              getClass().getClassLoader());

      loginContext = (LoginContext) config.getEntry(
    COMPONENT_NAME, "loginContext", LoginContext.class, null);
      if (loginContext == null) {
    init(config, persistent);
      } else {
    loginContext.login();
View Full Code Here

    {
  if (activationID != null && !persistent) {
      throw new IllegalArgumentException();
  }
  try {
      final Configuration config = ConfigurationProvider.getInstance(
    configArgs, getClass().getClassLoader());
      loginContext = (LoginContext) config.getEntry(
         COMPONENT, "loginContext", LoginContext.class, null);

      PrivilegedExceptionAction init = new PrivilegedExceptionAction() {
    public Object run() throws Exception {
        init(config, activationID, persistent, lifeCycle);
View Full Code Here

    public static void main(String[] args) {
       ensureSecurityManager();
       try {
           logger.entering(ServiceStarter.class.getName(),
         "main", (Object[])args);
           Configuration config = ConfigurationProvider.getInstance(args);
           ServiceDescriptor[] descs =  (ServiceDescriptor[])
             config.getEntry(START_PACKAGE, "serviceDescriptors",
                 ServiceDescriptor[].class, null);
           if (descs == null || descs.length == 0) {
               logger.warning("service.config.empty");
         return;
     }
           LoginContext loginContext =  (LoginContext)
         config.getEntry(START_PACKAGE, "loginContext",
             LoginContext.class, null);
     Result[] results = null;
     if (loginContext != null)
         results = createWithLogin(descs, config, loginContext);
     else
View Full Code Here

     * Internal utility method to intialize the locator constraints from
     * the <code>test.locatorConstraints</code> entry of the test
     * configuration file.
     */
    private static void initLocatorConstraints() {
  Configuration c = harnessConfig.configuration;
  try {
      testLocatorConstraints =
    (MethodConstraints) c.getEntry("test",
                 "locatorConstraints",
                 MethodConstraints.class);
  } catch (ConfigurationException e) {
      if (c instanceof QAConfiguration) {
    logger.log(Level.INFO,
View Full Code Here

     *                         is thrown
     */
    public Object prepare(String preparerName, Object target)
  throws TestException
    {
  Configuration c = getConfiguration();
  if (! (c instanceof QAConfiguration)) { // if true, none configuration
      return target;
  }
  String[] entryTokens = splitKey(preparerName);
  if (entryTokens == null) {
      throw new TestException("Illegal Preparer name: " + preparerName);
  }
  try {
      ProxyPreparer p = (ProxyPreparer) c.getEntry(entryTokens[0],
               entryTokens[1],
               ProxyPreparer.class);
      return p.prepareProxy(target);
  } catch (ConfigurationException e) {
      throw new TestException("Configuration Error preparing "
View Full Code Here

      }
  } catch (Throwable e) { // should never happen
            e.printStackTrace();
      exit(false, Test.ENV, "Problem during test initialization: " + e);
  }
  Configuration c = config.getConfiguration(); // the davis config
  LoginContext context = null;
  try {
      context = (LoginContext) c.getEntry("test",
            "loginContext",
            LoginContext.class,
            null);
      if (context != null) {
    logger.log(Level.FINEST, "got a login context");
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

  logger.entering(SharedGroupImpl.class.getName(), "SharedGroupImpl",
            new Object[] { activationID, data});
  this.activationID = activationID;
        try {
            String[] configArgs = (String[])data.get()
            final Configuration config =
                ConfigurationProvider.getInstance(configArgs);
            loginContext = (LoginContext) config.getEntry(
                START_PACKAGE, "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

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.