Examples of JavaConfig


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

  }

    public void
  testGetJVMOptions()
  {
      final JavaConfig    jc  = getConfigConfig().getJavaConfig();
     
      final String[]  jvmOptions  = jc.getJVMOptions();
     
      if ( jvmOptions.length < 2 )
      {
          warning( "Fewer than 2 JVM options, is this right: " +
              StringUtil.toString( jvmOptions ));
View Full Code Here

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

  testSetJVMOptions()
  {
      final String    newOption1  = "-DJavaConfigTest.OK=true";
      final String    newOption2  = "-XJavaConfigTest.OK=true";
     
      final JavaConfig    jc  = getConfigConfig().getJavaConfig();
     
      final Set<String>  beforeSet  = GSetUtil.newUnmodifiableStringSet( jc.getJVMOptions() );
     
      // add our new options
      final Set<String>   requestSet  = new HashSet<String>( beforeSet );
      requestSet.add( newOption1 );
      requestSet.add( newOption2 );
      jc.setJVMOptions( GSetUtil.toStringArray( requestSet ) );

      Set<String>  afterSet  = GSetUtil.newUnmodifiableStringSet( jc.getJVMOptions() );
     
      // make sure our new options are present
      assert( afterSet.contains( newOption1 ) );
      assert( afterSet.contains( newOption2 ) );
     
      // make sure all prior options are still present
      for( final String beforeOption : beforeSet )
      {
          assert( afterSet.contains( beforeOption ) );
      }
     
      // now remove our two options
      requestSet.remove( newOption1 );
      requestSet.remove( newOption2 );
      jc.setJVMOptions( GSetUtil.toStringArray( requestSet ) );
     
      // verify our two options are gone
      afterSet  = GSetUtil.newUnmodifiableStringSet( jc.getJVMOptions() );
      assert( ! afterSet.contains( newOption1 ) );
      assert( ! afterSet.contains( newOption2 ) );
     
      // make sure all prior options are still present
      assert( afterSet.equals( beforeSet ) );
View Full Code Here

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

 
    public void
  testGetters()
    throws Exception
  {
      final JavaConfig    jc  = getConfigConfig().getJavaConfig();
     
      String  s;
     
      s   = jc.getBytecodePreprocessors();
      if ( s != null )
      {
          jc.setBytecodePreprocessors( s );
      }

      s   = jc.getClasspathPrefix();
      if ( s != null )
      {
          jc.setClasspathPrefix( s );
      }

      s   = jc.getClasspathSuffix();
      if ( s != null )
      {
          jc.setClasspathSuffix( s );
      }

      s   = jc.getSystemClasspath();
      if ( s != null )
      {
          jc.setSystemClasspath( s );
      }

      final boolean debugEnabled =  jc.getDebugEnabled();
      jc.setDebugEnabled( debugEnabled );

      s   = jc.getDebugOptions();
      if ( s != null )
      {
          jc.setDebugOptions( s );
      }

      final boolean  envClasspathIgnored = jc.getEnvClasspathIgnored();
      jc.setEnvClasspathIgnored( envClasspathIgnored );

      s   = jc.getJavaHome();
      if ( s != null )
      {
          jc.setJavaHome( s );
      }

      s   = jc.getJavacOptions();
      if ( s != null )
      {
          jc.setJavacOptions( s );
      }

      final String[]  options = jc.getJVMOptions();
      if ( options != null )
      {
          jc.setJVMOptions( options );
      }

      s   = jc.getNativeLibraryPathPrefix();
      if ( s != null )
      {
          jc.setNativeLibraryPathPrefix( s );
      }

      s   = jc.getNativeLibraryPathSuffix();
      if ( s != null )
      {
          jc.setNativeLibraryPathSuffix( s );
      }

      s   = jc.getRMICOptions();
      if ( s != null )
      {
          jc.setRMICOptions( s );
      }

      s   = jc.getServerClasspath();
      if ( s != null )
      {
          jc.setServerClasspath( s );
      }
  }
View Full Code Here

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

  {
      if ( checkNotOffline( "testIllegalCreate" ) )
      {
          ensureDefaultInstance( getConfigConfig().getJavaConfig() );
         
          final JavaConfig    javaConfig    = getConfigConfig().getJavaConfig();
       
        javaConfig.removeProfilerConfig();
        assert javaConfig.getProfilerConfig() == null :
            "Can't remove ProfilerConfig from " +
                JMXUtil.toString( Util.getObjectName(javaConfig) );
       
        ensureDefaultInstance( javaConfig );
        assert javaConfig.getProfilerConfig() != null;
        Util.getExtra( javaConfig.getProfilerConfig() ).getMBeanInfo();
       
        testGetters( javaConfig.getProfilerConfig() );
       
        javaConfig.removeProfilerConfig();
        ensureDefaultInstance( javaConfig );
        assert javaConfig.getProfilerConfig() != null;
        Util.getExtra( javaConfig.getProfilerConfig() ).getMBeanInfo();
        testGetters( javaConfig.getProfilerConfig() );
    }
  }
View Full Code Here

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

     
      // set AMX-DEBUG.enabled=true in all ConfigConfig JVM options
      final Map<String,ConfigConfig> configs = getDomainConfig().getConfigConfigMap();
      for( final ConfigConfig config : configs.values() )
      {
          final JavaConfig jc = config.getJavaConfig();
          final Set<String>   jvmOptions  = GSetUtil.newStringSet( jc.getJVMOptions() );
         
          if ( ! ( jvmOptions.contains( AMX_DEBUG ) || jvmOptions.contains( AMX_DEBUG2 ) ))
          {
              jvmOptions.add( AMX_DEBUG );
              jc.setJVMOptions( GSetUtil.toStringArray( jvmOptions ) );
             
              // don't warn for default-config; it's not used by a running server
              if ( ! config.getName().equals( "default-config" ) )
              {
                  warning( "Enabled AMX-DEBUG for config " + config.getName()+
View Full Code Here

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

        @HandlerOutput(name="RmicOptions", type=String.class),
        @HandlerOutput(name="BytecodePreprocessor", type=String.class)})
        public static void getServerDefaultJvmAttributes(HandlerContext handlerCtx) {
       
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        JavaConfig javaConfig = config.getJavaConfig();
        String javaHome = javaConfig.getDefaultValue("JavaHome");
        String javacOptions = javaConfig.getDefaultValue("JavacOptions");
        String debugEnabled = javaConfig.getDefaultValue("DebugEnabled");
        String debugOptions = javaConfig.getDefaultValue("DebugOptions");
        String rmicOptions = javaConfig.getDefaultValue("RMICOptions");
        String bytecodePreprocessors = javaConfig.getDefaultValue("BytecodePreprocessors");
        handlerCtx.setOutputValue("JavaHome", javaHome);
        handlerCtx.setOutputValue("Options", javacOptions);
        if(debugEnabled.equals("true")) {
            handlerCtx.setOutputValue("DebugEnabled", true);   
        } else {
View Full Code Here

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

        @HandlerInput(name="RmicOptions", type=String.class),
        @HandlerInput(name="BytecodePreprocessor", type=String.class)})
        public static void saveServerJvmAttributes(HandlerContext handlerCtx) {
       
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        JavaConfig javaConfig = config.getJavaConfig();
       
        javaConfig.setJavaHome((String)handlerCtx.getInputValue("JavaHome"));
        javaConfig.setJavacOptions((String)handlerCtx.getInputValue("JavacOptions"));
        javaConfig.setDebugEnabled(((Boolean)handlerCtx.getInputValue("DebugEnabled")).booleanValue());
        javaConfig.setDebugOptions((String)handlerCtx.getInputValue("DebugOptions"));
        javaConfig.setRMICOptions((String)handlerCtx.getInputValue("RmicOptions"));
        javaConfig.setBytecodePreprocessors((String)handlerCtx.getInputValue("BytecodePreprocessor"));
       
    }
View Full Code Here

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

        @HandlerOutput(name="NativeLibPathPrefix", type=String.class),
        @HandlerOutput(name="NativeLibPathSuffix", type=String.class)})
        public static void getServerJvmPathSettings(HandlerContext handlerCtx) {
       
       ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        JavaConfig javaConfig = config.getJavaConfig();
        String systemClasspath = javaConfig.getSystemClasspath();
        String serverClasspath = javaConfig.getServerClasspath();
        boolean ignoreEnvClasspath = javaConfig.getEnvClasspathIgnored();
        String classpathPrefix = javaConfig.getClasspathPrefix();
        String classpathSuffix = javaConfig.getClasspathSuffix();
        String nativeLibPathPrefix = javaConfig.getNativeLibraryPathPrefix();
        String nativeLibPathSuffix = javaConfig.getNativeLibraryPathSuffix();
        handlerCtx.setOutputValue("SystemClasspath", formatStringsforViewing(systemClasspath));
        handlerCtx.setOutputValue("ServerClasspath", formatStringsforViewing(serverClasspath));
        handlerCtx.setOutputValue("IgnoreEnvClasspath", ignoreEnvClasspath);
        handlerCtx.setOutputValue("ClasspathPrefix", formatStringsforViewing(classpathPrefix));
        handlerCtx.setOutputValue("ClasspathSuffix", formatStringsforViewing(classpathSuffix));
View Full Code Here

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

        @HandlerInput(name="NativeLibPathPrefix", type=String.class),
        @HandlerInput(name="NativeLibPathSuffix", type=String.class)})
        public static void saveServerJvmPathSettings(HandlerContext handlerCtx) {
       
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        JavaConfig javaConfig = config.getJavaConfig();
        String sysCP = (String)handlerCtx.getInputValue("SystemClasspath");
        String serverCP = (String)handlerCtx.getInputValue("ServerClasspath");
        String cpPrefix = (String)handlerCtx.getInputValue("ClasspathPrefix");
        String cpSuffix = (String)handlerCtx.getInputValue("ClasspathSuffix");
        String nativePrefix = (String)handlerCtx.getInputValue("NativeLibPathPrefix");
        String nativeSuffix = (String)handlerCtx.getInputValue("NativeLibPathSuffix");
        javaConfig.setSystemClasspath(formatStringsforSaving(sysCP));
        javaConfig.setServerClasspath(formatStringsforSaving(serverCP));
        javaConfig.setEnvClasspathIgnored(((Boolean)handlerCtx.getInputValue("IgnoreEnvClasspath")).booleanValue());
        javaConfig.setClasspathPrefix(formatStringsforSaving(cpPrefix));
        javaConfig.setClasspathSuffix(formatStringsforSaving(cpSuffix));
        javaConfig.setNativeLibraryPathPrefix(formatStringsforSaving(nativePrefix));
        javaConfig.setNativeLibraryPathSuffix(formatStringsforSaving(nativeSuffix));
       
    }
View Full Code Here

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

            GuiUtil.handleError(handlerCtx, "saveJvmOptions(): NameList passed in is NULL");
            return;
        }
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        try{
            JavaConfig javaConfig = config.getJavaConfig();
            String[] options = (String[])names.toArray(new String[names.size()]);
            javaConfig.setJVMOptions(options);
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.