Examples of MBeanRegistry


Examples of com.sun.enterprise.admin.meta.MBeanRegistry

     * @param name The jndi name of the resource to be unregistered.
     * @param type The managed object type such as JDBCResource.
     * @throws Exception if the mbean cannot be unregistered.
     */
    void unregisterResource(String name, String type) throws Exception {
        final MBeanRegistry registry =
                MBeanRegistryFactory.getRuntimeMBeanRegistry();
        final String domainName =
                ApplicationServer.getServerContext().getDefaultDomainName();
        final String serverName =
                ApplicationServer.getServerContext().getInstanceName();
        final String[] location = new String[] {domainName, serverName, name};
        final ObjectName on = registry.getMbeanObjectName(type, location);
        if (on == null) {
            return;
        }
        final MBeanServer mbs =
               AdminService.getAdminService().getAdminContext().getMBeanServer();
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

    private void instantiateAndRegisterRuntimeMBean(
  String type, Object managed, String grandParentName,
  String parentName, String name) {

        MBeanRegistry registry  = MBeanRegistryFactory.getRuntimeMBeanRegistry();
        String domainName = ApplicationServer.getServerContext().getDefaultDomainName();
        String serverName = ApplicationServer.getServerContext().getInstanceName();
        try {
            if(grandParentName!=null) {

               registry.instantiateMBean(
      type,
      new String[]{domainName, serverName, grandParentName,
             parentName, name},
      managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
            } else {
                if(parentName!=null) {
                   registry.instantiateMBean(
        type,
        new String[]{domainName, serverName,
                     parentName, name},
        managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
                } else {
                    if(name!=null) {
                       registry.instantiateMBean(
        type, new String[]{domainName, serverName,name},
        managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
                    } else {
                       registry.instantiateMBean(
        type, new String[]{domainName, serverName},
        managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
        }
    }
      }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

    // for extension module type
    private void instantiateAndRegisterExtModuleRuntimeMBean(
  String type, Object managed, String grandParentName,
  String parentName, String name, String extModuleType) {

        MBeanRegistry registry  = MBeanRegistryFactory.getRuntimeMBeanRegistry();
        String domainName = ApplicationServer.getServerContext().getDefaultDomainName();
        String serverName = ApplicationServer.getServerContext().getInstanceName();
        try {
            if(grandParentName!=null) {

               registry.instantiateMBean(
      type,
      new String[]{domainName, serverName, grandParentName,
             parentName, name, extModuleType},
      managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
            } else {
                if(parentName!=null) {
                   registry.instantiateMBean(
        type,
        new String[]{domainName, serverName,
                     parentName, name, extModuleType},
        managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
                } else {
                    if(name!=null) {
                       registry.instantiateMBean(
        type, new String[]{domainName, serverName,name, extModuleType},
        managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
                    } else {
                       registry.instantiateMBean(
        type, new String[]{domainName, serverName, extModuleType},
        managed, AdminService.getAdminService().getAdminContext().getAdminConfigContext(), true); //FIXME
        }
    }
      }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

    private Object findElement_8_0(ObjectName objectName) throws InstanceNotFoundException
    {
        try
        {
            MBeanRegistry registry  = MBeanRegistryFactory.getAdminMBeanRegistry();
            return (Object)registry.findMBeanRegistryEntry(objectName);
        }
        catch(Exception e)
        {
            return null;
        }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

    Set _getClusterNames() throws
            ReflectionException, InstanceNotFoundException, MBeanException, java.io.IOException {

        final String [] domains = new String[] {MBeanRegistryFactory.getAdminContext().getDomainName()};
        final MBeanRegistry reg = MBeanRegistryFactory.getAdminMBeanRegistry();
        final MyClusters clusters  = (MyClusters)
            MBeanServerInvocationHandler.newProxyInstance( mConn, reg.getMbeanObjectName("clusters", domains) , MyClusters.class, false );
        final String []  names  = clusters.listClustersAsString("domain", false);
        return( ArrayConversion.toSet( names ) );
    }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

        final String [] domains = new String[] {
                MBeanRegistryFactory.getAdminContext().getDomainName(),
                clusterName,
                "config"
                };
        final MBeanRegistry reg = MBeanRegistryFactory.getAdminMBeanRegistry();
        return reg.getMbeanObjectName("cluster", domains);
    }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

        return( ArrayConversion.toSet( names ) );
    }

    private MyController getServersController() {
        final String [] domains = new String[] {MBeanRegistryFactory.getAdminContext().getDomainName()};
        final MBeanRegistry reg = MBeanRegistryFactory.getAdminMBeanRegistry();
        return (MyController)
            MBeanServerInvocationHandler.newProxyInstance(
                        mConn, reg.getMbeanObjectName("servers", domains) ,
                                MyController.class, false );
    }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

   
    private synchronized MBeanRegistryEntry getRegistryEntry(String xpath)
    {
        if(xpath.equals(lastXpath))
            return lastEntry;
        MBeanRegistry       registry = MBeanRegistryFactory.getAdminMBeanRegistry();
        MBeanRegistryEntry  entry = registry.findMBeanRegistryEntryByXPath(xpath);
        if(entry!=null)
        {
            lastXpath = xpath;
            lastEntry = entry;
        }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

    {
        HashSet xpathes = new HashSet();
        if(changeList==null)
            return xpathes;

        MBeanRegistry       registry = MBeanRegistryFactory.getAdminMBeanRegistry();
        String xpath_last = null;
        MBeanRegistryEntry  entry = null;
        boolean bLastEntryHasEvent = false;
        String propertyName = null;
       
        for(int i=0; i<changeList.size();i++)
        {
            ConfigChange change = (ConfigChange)changeList.get(i);
            int action = getActionCodeForChange(change);
            if(action==ElementChangeEvent.ACTION_ELEMENT_UNDEFINED)
                continue; //??? not add/set/update/delete
            String xpath = change.getXPath();
            // Check if this xpath belongs to one of the excluded
            // XPaths. Excluded xpaths include lb-configs, lb-config
            // etc. Where restart checks do not apply.
            if (  (xpath == null) || isXPathExcludedForRestartCheck(xpath) ) {
                continue;
            }
            if(!xpath.equals(xpath_last))
            {
                xpath_last = xpath;
                if(isPropertyXPath(change.getXPath()))
                {
                    propertyName = getConfigElementPrimaryKey(xpath);
                    xpath = getElementXPath(change);
                }
                else
                {
                    propertyName = null;
                }
                entry = registry.findMBeanRegistryEntryByXPath(xpath);
                if(entry==null)
                {
                    xpathes.add(xpath);
                    continue;
                }
View Full Code Here

Examples of com.sun.enterprise.admin.meta.MBeanRegistry

    public synchronized void registerConfigMBeans() {
        if(! _alreadyCalled ) {
            _alreadyCalled = true;
            try {
                final MBeanRegistry mr = MBeanRegistryFactory.getAdminMBeanRegistry();  
                mr.instantiateAndRegisterAllConfigMBeans(
                     adminContext.getAdminConfigContext(),
                     ApplicationServer.getServerContext().getDefaultDomainName());
            }
            catch (Throwable t) {
                 sLogger.log(Level.WARNING, "Error in registering configMBeans", t);
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.