001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JCAResource.java 6648 2005-04-26 16:19:08Z ehardesty $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.resource;
027:
028: // Java imports
029: import java.util.ArrayList;
030:
031: import org.objectweb.jonas.management.j2eemanagement.J2EEResource;
032:
033: /**
034: * MBean class for JCA Resource Management
035: *
036: * @author Adriana Danes JSR 77 (J2EE Management Standard)
037: *
038: */
039: public class JCAResource extends J2EEResource {
040:
041: // JSR 77
042: /**
043: * Array list of Connection Factories
044: */
045: private ArrayList connectionFactories = new ArrayList();
046: /**
047: * Array list of Admin Objects
048: */
049: private ArrayList adminObjects = new ArrayList();
050: /**
051: * Array list of ActivationSpecs
052: */
053: private ArrayList activationSpecs = new ArrayList();
054:
055: /**
056: * Constructor
057: * @param objectName String of object name
058: */
059: public JCAResource(String objectName) {
060: super (objectName);
061: }
062:
063: /**
064: * Get the Activationspec names
065: * @return String [] list of Activationspec names
066: */
067: public String[] getActivationSpecs() {
068: // return activationSpecs;
069: return ((String[]) activationSpecs
070: .toArray(new String[activationSpecs.size()]));
071: }
072:
073: /**
074: * Get the AdminObject names
075: * @return String [] list of AdminObject names
076: */
077: public String[] getAdminObjects() {
078: // return adminObjects;
079: return ((String[]) adminObjects.toArray(new String[adminObjects
080: .size()]));
081: }
082:
083: /**
084: * get the ConnectionFactory names
085: * @return String [] list of ConnectionFactory names
086: */
087: public String[] getConnectionFactories() {
088: // return connectionFactories;
089: return ((String[]) connectionFactories
090: .toArray(new String[connectionFactories.size()]));
091: }
092:
093: /**
094: * set the AdminObject name
095: * @param adminObjectName String of AdminObject name
096: */
097: public void setAdminObjects(String adminObjectName) {
098: adminObjects.add(adminObjectName);
099: }
100:
101: /**
102: * set the ActivationSpec name
103: * @param activationSpecsObjectName String of activationSpecs name
104: */
105: public void setActivationSpecs(String activationSpecsObjectName) {
106: activationSpecs.add(activationSpecsObjectName);
107: }
108:
109: /**
110: * set the ConnectionFactory name
111: * @param connectionFactoryObjectName String of ConnectionFactory name
112: */
113: public void setConnectionFactory(String connectionFactoryObjectName) {
114: connectionFactories.add(connectionFactoryObjectName);
115: }
116: }
|