Examples of CustomMBeanConfig


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

            Map <String, CustomMBeanConfig> customMBeanMap = AMXUtil.getDomainConfig().getCustomMBeanConfigMap();
            List<Map> selectedList = (List)handlerCtx.getInputValue("SelectedRows");
            boolean hasOrig = (selectedList == null || selectedList.size()==0) ? false: true;
            for(String key : customMBeanMap.keySet()){
                HashMap oneRow = new HashMap();
                CustomMBeanConfig mbeanConfig = customMBeanMap.get(key);
                String name = mbeanConfig.getName();
                String classname = mbeanConfig.getImplClassname();
                String status = TargetUtil.getEnabledStatus(mbeanConfig, true);
                boolean enabled = false;
                if(! AMXUtil.isEE()){
                    enabled = TargetUtil.isApplicationEnabled(mbeanConfig, "server");
                }       
View Full Code Here

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

            @HandlerOutput(name="StatusString",   type=String.class),
            @HandlerOutput(name="Result",         type=List.class),
            @HandlerOutput(name="Properties",     type=Map.class) })
     public static void getCustomMBeanValues(HandlerContext handlerCtx){
        try{
            CustomMBeanConfig mbeanConfig = null;
            boolean edit = ((Boolean)handlerCtx.getInputValue("Edit")).booleanValue();
            String implClassName = "";
            Map<String, String> props = new HashMap();
            boolean status = true;
            if(edit){
                mbeanConfig = AMXUtil.getDomainConfig().getCustomMBeanConfigMap().get(handlerCtx.getInputValue("CustomMBeanName"));
                implClassName = mbeanConfig.getImplClassname();
                handlerCtx.setOutputValue("ObjectName", mbeanConfig.getObjectNameInConfig());
                handlerCtx.setOutputValue("Description", mbeanConfig.getDescription());
                props = mbeanConfig.getProperties();
                if(AMXUtil.isEE()){
                    handlerCtx.setOutputValue("StatusString", TargetUtil.getEnabledStatus(mbeanConfig, true));
                }else{
                    status = TargetUtil.isApplicationEnabled(mbeanConfig, "server");
                }
            }else{
                implClassName = (String)handlerCtx.getInputValue("ClassName");
            }
            List result = new ArrayList();
            Object[] params = {implClassName};
            String[] signature = {"java.lang.String"};
            MBeanInfo mbinfo = (MBeanInfo) JMXUtil.invoke(APPS_OBJNAME, "getMBeanInfo", params, signature);
            MBeanAttributeInfo[] attrArray = mbinfo.getAttributes();
            if (attrArray != null && attrArray.length > 0){
                AttributeList attrList = null;
                if(edit){
                    String objName = "com.sun.appserv:type=mbean,category=config,name=" + mbeanConfig.getName();
                    attrList = (AttributeList) JMXUtil.invoke(objName, "getProperties", null, null);
                }
                for(int i=0; i<attrArray.length; i++){
                    HashMap oneRow = new HashMap();
                    String name = attrArray[i].getName();
                    oneRow.put("name", name);
                    oneRow.put("type", attrArray[i].getType());
                    oneRow.put("value", "");
                    if(edit){
                        if(Arrays.asList(mbeanConfig.getPropertyNames()).contains(name)){
                            oneRow.put("value", mbeanConfig.getPropertyValue(name));
                        }
                    }
                    result.add(oneRow);
                }
            }
View Full Code Here

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

            @HandlerInput(name="Targets",         type=String[].class),
            @HandlerInput(name="NewList",         type=List.class),
            @HandlerInput(name="OldList",         type=Map.class) })
     public static void saveCustomMBeanValues(HandlerContext handlerCtx){
        try{
            CustomMBeanConfig mbeanConfig = null;
            String beanName = (String)handlerCtx.getInputValue("CustomMBeanName");
            boolean edit = ((Boolean)handlerCtx.getInputValue("Edit")).booleanValue();
           
            String objNameProp = (String)handlerCtx.getInputValue("ObjectName");
            List newList = (List)handlerCtx.getInputValue("NewList");
View Full Code Here

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

            Object obj = handlerCtx.getInputValue("selectedRows");
            List selectedRows = (List) obj;
            for(int i=0; i< selectedRows.size(); i++){
                Map oneRow = (Map) selectedRows.get(i);
                String appName = (String) oneRow.get("name");
                CustomMBeanConfig mbeanConfig = AMXUtil.getDomainConfig().getCustomMBeanConfigMap().get(appName);
                List<String> targetList = TargetUtil.getDeployedTargets((AMX)mbeanConfig, true);
                if(targetList.size() == 0){
                    String operName = "removeMbeanByName";
                    Object[] params = new Object[]{appName};
                    String[] signature = new String[]{"java.lang.String"};
View Full Code Here

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

               JarExtract.extract(fileName, domainRoot+"/applications/mbeans");
            }
    }
   
    private static CustomMBeanConfig getCustomConfig(String implClassName){
        CustomMBeanConfig mbeanConfig = null;
        Iterator iter = AMXUtil.getDomainConfig().getCustomMBeanConfigMap().values().iterator();
        if (iter != null){
            while(iter.hasNext()){
                mbeanConfig = (CustomMBeanConfig) iter.next();
                String className = mbeanConfig.getImplClassname();
                if(className.equals(implClassName)){
                    break;
                }
            }
        }
View Full Code Here

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

        }
        return mbeanConfig;
    }
   
    private static CustomMBeanConfig createCustomConfig(String[] targets, Map propsMap, Object attributes, boolean enabled){
        CustomMBeanConfig mbeanConfig = null;
        if(targets == null || targets.length == 0) {
            //By default deploying to DAS to be in sync. with CLI.
            targets = new String[]{"server"};
        }
        String operName ="createMBean";
View Full Code Here

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

            Vector newTargets = new Vector();
            Map attrsMap = new HashMap();
            Map propsMap = new HashMap();
            for(String targetName:targets) {
                if(!(associatedTargets.contains(targetName))) {
                    CustomMBeanConfig mbeanConfig = AMXUtil.getDomainConfig().getCustomMBeanConfigMap().get(name);
                    String implClassName = mbeanConfig.getImplClassname();
                    attrsMap.putAll(mbeanConfig.getProperties());
                    propsMap.put("name", name);
                    propsMap.put("impl-class-name", implClassName);
                    newTargets.add(targetName);
                }              
            }
View Full Code Here

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

    }
   
        public static CustomMBeanConfig
  ensureDefaultInstance( final DomainConfig domainConfig )
  {
      CustomMBeanConfig   result  =
          domainConfig.getCustomMBeanConfigMap().get( getDefaultInstanceName() );
     
      if ( result == null )
      {
          result  = createInstance(
View Full Code Here

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

  createInstance(
      final DomainConfig          domainConfig,
      final String                name,
      final Map<String,String> optional )
  {
      final CustomMBeanConfig custom  =
          domainConfig.createCustomMBeanConfig( name, IMPL_CLASSNAME,
          createObjectName( name ),
          false,
          optional );
     
View Full Code Here

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

              RefHelper.removeAllRefsTo( existing.get( testName ), true );
              // leftover from a failed test...
              removeCustomMBean( testName );
          }
         
          final CustomMBeanConfig config  =
              create( domainConfig, TEST_NAME_BASE + i, optional );
          //printVerbose( "created: " + Util.getObjectName( config ) );
         
          assert( getCustomMBeanConfigs().get( config.getName() ) == config );
         
          created.add( config );
          sanityCheck( config );
         
          verifyPropsAdded( config, optional );
      }
     
      _testGetAll();
      _testAttrs();
     
      for( final CustomMBeanConfig config : created )
      {
          //printVerbose( "removing: " + Util.getObjectName( config ) );
          final String    name    = config.getName();
          removeCustomMBean( name );
         
          assert( getCustomMBeanConfigs().get( name ) == null );
      }
     
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.