Package com.sun.enterprise.admin.target

Examples of com.sun.enterprise.admin.target.Target


    }

    public boolean deleteStoreProperties(String targetName)
        throws MBeanException
    {
        final Target target = getTarget(targetName);  
        check1ToN(target);
        final ObjectName sessionManager = getSessionManagerMBean(target, false);
        invoke0(sessionManager, "removeStoreProperties");
        return true;
    }
View Full Code Here


//Session Config
    public boolean deleteSessionConfig(String targetName)
        throws MBeanException
    {
        final Target target = getTarget(targetName);
        check1ToN(target);
        final ObjectName webContainer = getChild("web-container", null, target);
        invoke0(webContainer, "removeSessionConfig");
        return true;
    }
View Full Code Here

    }

    public ObjectName getSsl(String type, String id, String targetName)
        throws MBeanException
    {
        final Target target = getListTarget(targetName);
        ObjectName sslTarget = getSslTargetObjectName(target, id, type);
        if ("iiop-service".equals(type))
        {
            sslTarget = (ObjectName)invoke0(sslTarget, "getSslClientConfig");
        }
View Full Code Here

   
    protected Target getTarget(String targetName) throws MBeanException
    {       
        try
        {              
            Target target = TargetBuilder.INSTANCE.createTarget(VALID_CREATE_DELETE_TYPES, targetName,
                getConfigContext());
            if (target.getType() == TargetType.SERVER ||
                target.getType() == TargetType.DAS) {
                //If we are operating on a server, ensure that the server is the only entity
                //referencing its config
                String configName = ServerHelper.getConfigForServer(getConfigContext(),
                    target.getName()).getName();
                if (!ConfigAPIHelper.isConfigurationReferencedByServerOnly(getConfigContext(),
                    configName, target.getName())) {
                        throw new ConfigException(localStrings.getString(
                            "configurationHasMultipleRefs", target.getName(), configName,
                            ConfigAPIHelper.getConfigurationReferenceesAsString(
                                getConfigContext(), configName)));  
                }                                             
            } else if (target.getType() == TargetType.CLUSTER) {
                //If we are operating on a cluster, ensure that the cluster is the only entity
                //referencing its config
                String configName = ClusterHelper.getConfigForCluster(getConfigContext(),
                    target.getName()).getName();
                if (!ConfigAPIHelper.isConfigurationReferencedByClusterOnly(getConfigContext(),
                    configName, target.getName())) {
                        throw new ConfigException(localStrings.getString(
                            "configurationHasMultipleRefs", target.getName(), configName,
                            ConfigAPIHelper.getConfigurationReferenceesAsString(
                                getConfigContext(), configName)));
                }    
            }
            return target;
View Full Code Here

   
    private ObjectName processTarget(final String processName) throws RuntimeException {
        try {
            final TargetType[] vts = {TargetType.DAS, TargetType.SERVER};
            final ConfigContext acc = AdminService.getAdminService().getAdminContext().getAdminConfigContext();
            final Target t = TargetBuilder.INSTANCE.createTarget(null, vts, processName, acc); //DAS is the default target
            //get the object-name of the "other" real implementation of JVMInformationMBean interface :)
            final String sn = t.getName();
            final String cn = JVMInformation.class.getSimpleName();
            final ObjectName on = formObjectName(sn, cn);
            if (! this.mbsc.isRegistered(on)) {
                final String msg = sm.getString("server.unreachable", sn);
                throw new RuntimeException(msg);
View Full Code Here

  
    public void clearStatus(String targetName) throws InstanceException
    {       
        try {                  
            ConfigContext configContext = getConfigContext();
            Target target = TargetBuilder.INSTANCE.createTarget(
                VALID_TYPES, targetName, configContext);                             
            if (target.getType() == TargetType.NODE_AGENT) {               
                //Clear status of the specified node agent
        getNodeAgentsConfigBean().clearRuntimeStatus(
                    target.getNodeAgents()[0].getName());
            } else if (target.getType() == TargetType.DOMAIN) {
                //Clear status of all node agents and server instances
                final Server[] servers = target.getServers();
                final int numServers = servers.length;
                final NodeAgent[] agents = target.getNodeAgents();
                final int numAgents = agents.length;               
                for (int i = 0; i < numServers; i++) {               
                    getServersConfigBean().clearRuntimeStatus(
                        servers[i].getName());
                }
                for (int i = 0; i < numAgents; i++) {
                    getNodeAgentsConfigBean().clearRuntimeStatus(
                        agents[i].getName());
                }
            } else {                       
                //Clear status of server instance or server instances in a cluster
                final Server[] servers = target.getServers();         
                final int numServers = servers.length;                   
                for (int i = 0; i < numServers; i++) {               
                    getServersConfigBean().clearRuntimeStatus(
                        servers[i].getName());
                }
View Full Code Here

       
    public RuntimeStatusList getStatus(String targetName) throws InstanceException
    {
        try {                  
            ConfigContext configContext = getConfigContext();
            Target target = TargetBuilder.INSTANCE.createTarget(
                DOMAIN_TARGET, VALID_TYPES, targetName, configContext);     
            RuntimeStatusList result = new RuntimeStatusList()
            if (target.getType() == TargetType.NODE_AGENT) {
                //Get status for the specified node agent               
        result.add(getNodeAgentsConfigBean().getRuntimeStatus(
                    target.getNodeAgents()[0].getName()));
            } else if (target.getType() == TargetType.DOMAIN) {
                //Get status for all node agents and server instances in the domain
                final Server[] servers = target.getServers();
                final int numServers = servers.length;
                final NodeAgent[] agents = target.getNodeAgents();
                final int numAgents = agents.length;                           
                for (int i = 0; i < numServers; i++) {               
                    result.add(getServersConfigBean().getRuntimeStatus(
                        servers[i].getName()));
                }
                for (int i = 0; i < numAgents; i++) {
                    result.add(getNodeAgentsConfigBean().getRuntimeStatus(
                        agents[i].getName()));
                }
            } else {                       
                //Get status for the instance or instances in the specified cluster
                final Server[] servers = target.getServers();         
                final int numServers = servers.length;
                //Check for a zero length cluster as a special case we would like
                //to report a non-running status.
                if (numServers == 0 && target.getType() == TargetType.CLUSTER) {                   
                    result.add(getClustersConfigBean().getRuntimeStatus(
                        target.getClusters()[0].getName()));
                } else {                                  
                    for (int i = 0; i < numServers; i++) {               
                        result.add(getServersConfigBean().getRuntimeStatus(
                            servers[i].getName()));
                    }
View Full Code Here

    public String[] listApplicationReferencesAsString(String targetName)
         throws ConfigException
    {
        try {           
            final ConfigContext configContext = getConfigContext();       
            final Target target = TargetBuilder.INSTANCE.createTarget(VALID_LIST_TYPES,
                targetName, configContext);   
            ApplicationRef[] refs = target.getApplicationRefs();                      
            String[] result = new String[refs.length];
            for (int i = 0; i < refs.length; i++) {
                result[i] = refs[i].getRef();
            }
            return result;         
View Full Code Here

    public void processSessionStore(String operation, String serverName, String waitTime, String drainTime) throws InstanceException
    {
        ConfigContext ctx = getConfigContext();
        try {
            //validate that the server exists
            final Target target = TargetBuilder.INSTANCE.createTarget(VALID_TYPES, serverName, ctx);
        } catch (Exception e) {
            throw new InstanceException(sm.getString("noSuchInstance", serverName));
        }
        long wTime = 0;
        long dTime = 0;
View Full Code Here

     * @param attributes a Ma<String, String> that could contain the settable attributes of the MBean.
     */
    public String createMBean(final String target, final Map<String, String> params, final Map<String, String> attributes) throws CustomMBeanException {
        boolean mbeanDefinitionCreated = false;
        try {
            final Target t = TargetBuilder.INSTANCE.createTarget(target, vTargets, target, this.acc);
            final TargetType pType = t.getType();
            final String newTarget = t.getName();
            //note: mutates the passed params for "NAME_KEY"
            mbeanDefinitionCreated = createMBeanDefinitionIfAbsent(newTarget, params, attributes);
            final String name = params.get(CustomMBeanConstants.NAME_KEY);
            if (TargetType.DOMAIN.equals((pType))) {
                //this should create the MBean definition only
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.target.Target

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.