Package com.sun.enterprise.admin.target

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


   

    private void deleteAResourceRef(Resource resource, List<String> targetNames) throws Exception {
        //System.out.println("ResourcesMBean deleteAResourceRef " + resource.getType());
        for (String tgt : targetNames) {
            Target target = getResourceTarget(tgt);
            if (isResourceReferenceValid(resource.getType(),target.getType())) {
                this.deleteResourceRef(getResourceName(resource.getType(), resource.getAttributes()), target, tgt);
            }
        }
    }
View Full Code Here


    {
        ObjectName mbean = null;       

//        try
        {
            final Target target = TargetBuilder.INSTANCE.createTarget(
                VALID_LIST_TYPES, tgtName, getConfigContext());
            String opName = "";
            if (resType.equals(RESOURCE_ADAPTER_CONFIG)) {
                // opName is getResourceAdapterConfigByResourceAdapterName
                opName = GET + ConfigMBeanHelper.convertTagName(resType) + "By" + ConfigMBeanHelper.convertTagName(ServerTags.RESOURCE_ADAPTER_NAME);
View Full Code Here

    }

    public ObjectName[] getJmsResource( String resType, String tgtName )
        throws Exception
    {
        Target target = getResourceTarget(tgtName);
        ObjectName[] QRes = null;
        ObjectName[] TRes = null;
        ObjectName[] QCFRes = null;
        ObjectName[] TCFRes = null;
        ObjectName[] uCFRes = null;
View Full Code Here

    private ObjectName[] getResource( String resType, String tgtName )
       throws Exception
    {            
        ArrayList result = new ArrayList();

        final Target target = TargetBuilder.INSTANCE.createTarget(
            VALID_LIST_TYPES, tgtName, getConfigContext());           
        ObjectName[] mbean = (ObjectName[])super.invoke( GET + ConfigMBeanHelper.convertTagName(resType), null, null);

        /**
            resource-ref business doesnot apply to jdbc-connection-pool,
            connector-connection-pool & resource-adapter-config. So return
            the pools as if the target were domain. &

            If the target is domain, return all the resources of the specific
            type.
         */
        if (CONNECTOR_CONNECTION_POOL.equals(resType) ||
            JDBC_CONNECTION_POOL.equals(resType) ||
            RESOURCE_ADAPTER_CONFIG.equals(resType) ||
            (target.getType() == TargetType.DOMAIN))
        {
            return mbean;
        }


        if (target.getType() == TargetType.SERVER ||
            target.getType() == TargetType.CLUSTER ||
            target.getType() == TargetType.DAS) {
            //filter out only those resources referenced by the target           
            ResourceRef[] refs = target.getResourceRefs();                  
            String objectProps = null;
            for (int i = 0; i < mbean.length; i++) {
                for (int j = 0; j < refs.length; j++) {
                    objectProps = mbean[i].getKeyPropertyListString();                   
                    if (objectProps.indexOf(refs[j].getRef()) > 0) {
View Full Code Here

        // If yes, throw MBeanException that it can't be deleted as it is being
        // referenced by jdbc-resource in case cascade is false
        boolean crFound = false;
        boolean pmfFound = false;

        Target target = getResourceTarget(tgtName);

//        try {
            String[] resArr = null;
            String[] pmfArr = null;
View Full Code Here

    public void deleteJmsResource( String name, String tgtName )
        throws Exception
    {
//        try {
            Target target = getResourceTarget(tgtName);
            ObjectName connResource = null;
            try {
               connResource = (ObjectName)super.invoke("getConnectorResourceByJndiName", new Object[]{name}, new String[]{"java.lang.String"});
            } catch (Exception ee){};
View Full Code Here

              CONNECTOR_CONNECTION_POOL.equals(resType))) {
            /*
                delete the resource-refs before calling the delete for this
                resource.
             */
            Target target = getResourceTarget(tgtName);
            deleteResourceRef(name, target, tgtName);
        }

        // Invoke removeXXXByXXXName() for the appropriate MBean
        super.invoke(operation,new Object[]{name},new String[] {"java.lang.String"});
View Full Code Here

     * Temporary method for PE. This method should ideally be in Runtime MBean.
     */
    public Boolean pingConnectionPool(String poolName, String tgtName) throws Exception
    {
        boolean retVal = false;
        final Target target;      

//        try
        {
            //FIXTHIS: Not sure why this can only be a server instance. We should be
            //able to reference a server, domain, or cluster here.
View Full Code Here

                    destProps.put(maxConsumersAttribute, maxConsumersValue);
                }
            }

        // check and use JMX
            Target target = getResourceTarget(tgtName);
        if (JMSDestination.useJMX(target)) {
          JMSDestination jmsd = new JMSDestination();
          jmsd.createJMSDestination(destName, destType, destProps, tgtName);
          return;
        } else {
View Full Code Here

        JMSAdmin jmsAdmin = null;
        boolean connected = false;

        try {
        // check and use JMX
            Target target = getResourceTarget(tgtName);
        if (JMSDestination.useJMX(target)) {
          JMSDestination jmsd = new JMSDestination();
          jmsd.deleteJMSDestination(destName, destType, tgtName);
          return;
        } else {
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.