Examples of AMXConfigProxy


Examples of org.glassfish.admin.amx.config.AMXConfigProxy

    {
        if (!AMXConfigProxy.class.isAssignableFrom(proxy.extra().genericInterface()))
        {
            return;
        }
        final AMXConfigProxy config = proxy.as(AMXConfigProxy.class);

        // All AMXConfig must be descendants of Domain
        if ( ! config.type().equals( "domain" ) )   // hard-coded type, we can't import Domain.class here
        {
            // verify that all its ancestors are also AMXConfig
            // Do a quick check, ultimately if all AMXConfig have an AMXConfig as a parent,
            // then they all have DomainConfig as a parent.
            if ( ! AMXConfigProxy.class.isAssignableFrom(config.parent().extra().genericInterface() ) )
            {
                problems.add("AMXConfig MBean is not a descendant of Domain: " + config.objectName() + ", it has parent " + config.getParent() );
            }
        }
       
        // check default values support
        final Map<String, String> defaultValues = config.getDefaultValues(false);
        final Map<String, String> defaultValuesAMX = config.getDefaultValues(true);
        if (defaultValues.keySet().size() != defaultValuesAMX.keySet().size())
        {
            problems.add("Default values for AMX names differ in number from XML names: " + defaultValues.keySet().size() + " != " + defaultValuesAMX.keySet().size());
        }
        for (final String key : defaultValues.keySet())
        {
            final Object value = defaultValues.get(key);
            if (value == null)
            {
                problems.add("Default value of null for: " + key);
            }
            else if (!(value instanceof String))
            {
                problems.add("Default value is not a String for: " + key);
            }
        }

        final String[] subTypes = config.extra().subTypes();
        if (subTypes != null)
        {
            for (final String subType : subTypes)
            {
                final Map<String, String> subTypeDefaults = config.getDefaultValues(subType, false);
            }
        }
    }
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

            meta.setDeploymentDescriptor( xmlDesc );
        }
        final String moduleName = ejbBundleDescriptor.getModuleName();
        final String appLocation = appConfig.getLocation();
       
        final AMXConfigProxy moduleConfig = getModuleConfig(appConfig, moduleName );
        meta.setCorrespondingConfig(moduleConfig.objectName());
       
        final ObjectName ejbModuleObjectName = registerJ2EEChild(parentMBean, meta, EJBModule.class, EJBModuleImpl.class, moduleName);
       
        meta.remove( Metadata.CORRESPONDING_CONFIG );   // none for an EJB MBean
        meta.remove( Metadata.DEPLOYMENT_DESCRIPTOR );   // none for an EJB MBean
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

        }
       
        final String moduleName = webBundleDescriptor.getModuleName();
        final String appLocation = appConfig.getLocation();
       
        final AMXConfigProxy moduleConfig = getModuleConfig(appConfig, moduleName );
        meta.setCorrespondingConfig(moduleConfig.objectName());

        final ObjectName webModuleObjectName = registerJ2EEChild(parentMBean, meta, WebModule.class, WebModuleImpl.class, moduleName);

        meta.remove( Metadata.CORRESPONDING_CONFIG );   // none for a Servlet
        meta.remove( Metadata.DEPLOYMENT_DESCRIPTOR );   // none for an Servlet
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

            final String appLocation)
    {
        meta.setCorrespondingConfig(appConfig.objectName());
        final ObjectName objectName = createRARModuleMBean(parentMBean, meta, appConfig, bundleDesc);
       
        final AMXConfigProxy moduleConfig = getModuleConfig(appConfig, bundleDesc.getModuleName() );
        meta.setCorrespondingConfig(moduleConfig.objectName());
       
        final ObjectName rarObjectName = registerJ2EEChild(objectName, meta, ResourceAdapter.class, ResourceAdapterImpl.class, bundleDesc.getName());

        return objectName;
    }
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

            cdebug("ResourceRef is not a child of server " + mServerConfig.objectName());
            return null;
        }

        // find the referenced resource
        final AMXConfigProxy amxConfig = new AMXConfigGetters(ref).getResource(ref.getName());
        if (amxConfig == null)
        {
            throw new IllegalArgumentException("ResourceRef refers to non-existent resource: " + ref);
        }

        final String configType = amxConfig.type();
        final Class<J2EEManagedObjectImplBase> implClass = CONFIG_RESOURCE_TYPES.get(configType);
        if (implClass == null)
        {
            ImplUtil.getLogger().fine("Unrecognized resource type for JSR 77 purposes: " + amxConfig.objectName());
            return null;
        }
        final Class<J2EEManagedObject> intf = (Class) ClassUtil.getFieldValue(implClass, "INTF");
        final String j2eeType = Util.deduceType(intf);

        ObjectName mbean77 = null;
        try
        {
            final MetadataImpl meta = new MetadataImpl();
            meta.setCorrespondingRef(ref.objectName());
            meta.setCorrespondingConfig(amxConfig.objectName());
           
            mbean77 = registerJ2EEChild(mJ2EEServer.objectName(), meta, intf, implClass, amxConfig.getName());
            synchronized (mConfigRefTo77)
            {
                mConfigRefTo77.put(ref.objectName(), mbean77);
            }
        }
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

    {
        if (!AMXConfigProxy.class.isAssignableFrom(proxy.extra().genericInterface()))
        {
            return;
        }
        final AMXConfigProxy config = proxy.as(AMXConfigProxy.class);

        // All AMXConfig must be descendants of Domain
        if ( ! config.type().equals( "domain" ) )   // hard-coded type, we can't import Domain.class here
        {
            // verify that all its ancestors are also AMXConfig
            // Do a quick check, ultimately if all AMXConfig have an AMXConfig as a parent,
            // then they all have DomainConfig as a parent.
            if ( ! AMXConfigProxy.class.isAssignableFrom(config.parent().extra().genericInterface() ) )
            {
                problems.add("AMXConfig MBean is not a descendant of Domain: " + config.objectName() + ", it has parent " + config.getParent() );
            }
        }
       
        // check default values support
        final Map<String, String> defaultValues = config.getDefaultValues(false);
        final Map<String, String> defaultValuesAMX = config.getDefaultValues(true);
        if (defaultValues.keySet().size() != defaultValuesAMX.keySet().size())
        {
            problems.add("Default values for AMX names differ in number from XML names: " + defaultValues.keySet().size() + " != " + defaultValuesAMX.keySet().size());
        }
        for (final Map.Entry<String,String> me : defaultValues.entrySet())
        {
            final Object value = me.getValue();
            if (value == null)
            {
                problems.add("Default value of null for: " + me.getKey());
            }
            else if (!(value instanceof String))
            {
                problems.add("Default value is not a String for: " + me.getKey());
            }
        }

        final String[] subTypes = config.extra().subTypes();
        if (subTypes != null)
        {
            for (final String subType : subTypes)
            {
                config.getDefaultValues(subType, false);
            }
        }
    }
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

            meta.setDeploymentDescriptor( xmlDesc );
        }
        final String moduleName = ejbBundleDescriptor.getModuleName();
        final String appLocation = appConfig.getLocation();
       
        final AMXConfigProxy moduleConfig = getModuleConfig(appConfig, moduleName );
        meta.setCorrespondingConfig(moduleConfig.objectName());
       
        final ObjectName ejbModuleObjectName = registerJ2EEChild(parentMBean, meta, EJBModule.class, EJBModuleImpl.class, moduleName);
       
        meta.remove( Metadata.CORRESPONDING_CONFIG );   // none for an EJB MBean
        meta.remove( Metadata.DEPLOYMENT_DESCRIPTOR );   // none for an EJB MBean
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

        }
       
        final String moduleName = webBundleDescriptor.getModuleName();
        final String appLocation = appConfig.getLocation();
       
        final AMXConfigProxy moduleConfig = getModuleConfig(appConfig, moduleName );
        meta.setCorrespondingConfig(moduleConfig.objectName());

        final ObjectName webModuleObjectName = registerJ2EEChild(parentMBean, meta, WebModule.class, WebModuleImpl.class, moduleName);

        meta.remove( Metadata.CORRESPONDING_CONFIG );   // none for a Servlet
        meta.remove( Metadata.DEPLOYMENT_DESCRIPTOR );   // none for an Servlet
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

            final String appLocation)
    {
        meta.setCorrespondingConfig(appConfig.objectName());
        final ObjectName objectName = createRARModuleMBean(parentMBean, meta, appConfig, bundleDesc);
       
        final AMXConfigProxy moduleConfig = getModuleConfig(appConfig, bundleDesc.getModuleName() );
        meta.setCorrespondingConfig(moduleConfig.objectName());
       
        final ObjectName rarObjectName = registerJ2EEChild(objectName, meta, ResourceAdapter.class, ResourceAdapterImpl.class, bundleDesc.getName());

        return objectName;
    }
View Full Code Here

Examples of org.glassfish.admin.amx.config.AMXConfigProxy

            cdebug("ResourceRef is not a child of server " + mServerConfig.objectName());
            return null;
        }

        // find the referenced resource
        final AMXConfigProxy amxConfig = new AMXConfigGetters(ref).getResource(ref.getName());
        if (amxConfig == null)
        {
            throw new IllegalArgumentException("ResourceRef refers to non-existent resource: " + ref);
        }

        final String configType = amxConfig.type();
        final Class<J2EEManagedObjectImplBase> implClass = CONFIG_RESOURCE_TYPES.get(configType);
        if (implClass == null)
        {
            mLogger.fine("Unrecognized resource type for JSR 77 purposes: " + amxConfig.objectName());
            return null;
        }
        final Class<J2EEManagedObject> intf = (Class) ClassUtil.getFieldValue(implClass, "INTF");
        final String j2eeType = Util.deduceType(intf);

        ObjectName mbean77 = null;
        try
        {
            final MetadataImpl meta = new MetadataImpl();
            meta.setCorrespondingRef(ref.objectName());
            meta.setCorrespondingConfig(amxConfig.objectName());
           
            mbean77 = registerJ2EEChild(mJ2EEServer.objectName(), meta, intf, implClass, amxConfig.getName());
            synchronized (mConfigRefTo77)
            {
                mConfigRefTo77.put(ref.objectName(), mbean77);
            }
        }
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.