Package com.sun.appserv.management.config

Examples of com.sun.appserv.management.config.StandaloneServerConfig


    private static Vector getReferencedInstances(String configName){
        Vector targets = new Vector();
        Map standaloneMap = AMXUtil.getDomainConfig().getStandaloneServerConfigMap();
        Map clusteredMap = AMXUtil.getDomainConfig().getClusteredServerConfigMap();
        for(Iterator it = standaloneMap.values().iterator(); it.hasNext();){
            StandaloneServerConfig server = (StandaloneServerConfig) it.next();
            String config = server.getReferencedConfigName();
            if(config.equalsIgnoreCase(configName)){
                targets.add(server);
            }
        }
        for(Iterator it = clusteredMap.values().iterator(); it.hasNext();){
            ClusteredServerConfig server = (ClusteredServerConfig) it.next();
            String config = server.getReferencedConfigName();
            if(config.equalsIgnoreCase(configName)){
                targets.add(server);
            }
        }
       
View Full Code Here


                    }else{
                        if (!GuiUtil.isEmpty(propValue))
                            clusterConfig.createSystemProperty(propName, propValue);
                    }
                }else{
                    StandaloneServerConfig serverConfig = AMXUtil.getDomainConfig().getStandaloneServerConfigMap().get(instanceName);
                    if(Arrays.asList(serverConfig.getSystemPropertyNames()).contains(propName)){
                        if (GuiUtil.isEmpty(propValue))
                            serverConfig.removeSystemProperty(propName);
                        else
                            serverConfig.setSystemPropertyValue(propName, propValue);
                    }else{
                        if (!GuiUtil.isEmpty(propValue))
                            serverConfig.createSystemProperty(propName, propValue);
                    }
                }
            }
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
View Full Code Here

        final ConfigConfig  config  = setup.createConfig( configName );
        try
        {
            final int       basePort    = 34770;
           
            final StandaloneServerConfig server =
                setup.createServer( serverName, basePort, nodeAgentName, configName );
            try
            {
            final ResourceRefConfig ref =
                server.createResourceRefConfig( MAIL_RESOURCE_NAME );
            assert( ref != null );
           
                server.removeResourceRefConfig( ref.getName() );
            }
            catch( Exception e )
            {
                setup.removeServer( serverName );
                throw e;
View Full Code Here

      }
     
      final String MISSING_NAME   = "NonExistent";
     
      final DomainConfig domainConfig = getDomainRoot().getDomainConfig();
      final StandaloneServerConfig serverConfig =
          domainConfig.getStandaloneServerConfigMap().get( "server" );
     
      try
      {
          serverConfig.createResourceRefConfig( MISSING_NAME );
          assert false;
         
          serverConfig.createDeployedItemRefConfig( MISSING_NAME );
          assert false;
      }
      catch( Exception e )
      {
          // good
View Full Code Here

   
    // now deploy again and leave in place, for the use of subsequent unit tests
    moduleIDs   = deployModules( archives );
   
    // now add references to them in server
    final StandaloneServerConfig server   =
        getDomainConfig().getStandaloneServerConfigMap().get( "server" );
    for( final String moduleID : moduleIDs )
    {
        server.createDeployedItemRefConfig( moduleID );
        println( "Added ref to: " + moduleID );
    }
  }
View Full Code Here

  }
 
      protected void
  addReference( final ResourceConfig rc )
  {
      final StandaloneServerConfig    server  =
          StandaloneServerConfigTest.ensureDefaultInstance( getDomainRoot() );
      assert server != null;
     
      if ( server.getResourceRefConfigMap().get( rc.getName() ) != null )
      {
          warning( "ResourceRefConfig already exists for: " + rc.getName() );
      }
      else
      {
          try
          {
              server.createResourceRefConfig( rc.getName(), false );
          }
          catch( Exception e )
          {
              final Throwable rootCause   = ExceptionUtil.getRootCause( e );
             
              warning( "Couldn't add RefConfig to: " + Util.getObjectName( rc ) );
          }
      }
     
      assert server.getResourceRefConfigMap().get( rc.getName() ) != null;
  }
View Full Code Here

      {
          result  = createInstance( dc, getDefaultInstanceName(),
              MAIL_RESOURCE_HOST, MAIL_RESOURCE_USER, MAIL_RESOURCE_FROM, OPTIONS);
            assert ! result.getEnabled();
           
            final StandaloneServerConfig serverConfig = dc.getStandaloneServerConfigMap().get( "server" );
           
            final Map<String,String> options = new HashMap<String,String>();
            options.put( ResourceConfigKeys.ENABLED_KEY, "false" );
            final ResourceRefConfig ref = serverConfig.createResourceRefConfig( result.getName(), options );
            assert ! ref.getEnabled();
           
            RefHelper.removeAllRefsTo( result, false );
      }
     
View Full Code Here

  ensureDefaultInstance( final DomainRoot domainRoot )
  {
      final Map<String,StandaloneServerConfig>    servers =
          domainRoot.getDomainConfig().getStandaloneServerConfigMap();
     
      StandaloneServerConfig  server  = servers.get( getDefaultInstanceName() );
      assert( server != null );
     
      return server;
  }
View Full Code Here

                // sanity check
                final Map<String,Object>    attrs   = Util.getExtra( config ).getAllAttributes();
               
                try
                {
                    final StandaloneServerConfig  server =
                        setup.createServer( serverName, basePort, nodeAgentName, config.getName() );
                    // it worked, get rid of it
                    setup.removeServer( server.getName() );
                }
                catch( Throwable t)
                {
                    assert false : ExceptionUtil.toString( t );
                }
View Full Code Here

    {
        final Map<String,String>    options = new HashMap<String,String>();
       
        setupServerPorts( options, basePort );
       
        final StandaloneServerConfig  server =
            getDomainConfig().createStandaloneServerConfig(
                name, nodeAgentName, configName, options );
           
        return server;
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.config.StandaloneServerConfig

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.