KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > resource > JCAResource


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JCAResource.java,v 1.5 2005/04/26 16:19:06 ehardesty Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.resource;
27
28 // Java imports
29
import java.util.ArrayList JavaDoc;
30
31 import org.objectweb.jonas.management.j2eemanagement.J2EEResource;
32
33 /**
34  * MBean class for JCA Resource Management
35  *
36  * @author Adriana Danes JSR 77 (J2EE Management Standard)
37  *
38  */

39 public class JCAResource extends J2EEResource {
40
41     // JSR 77
42
/**
43      * Array list of Connection Factories
44      */

45     private ArrayList JavaDoc connectionFactories = new ArrayList JavaDoc();
46     /**
47      * Array list of Admin Objects
48      */

49     private ArrayList JavaDoc adminObjects = new ArrayList JavaDoc();
50     /**
51      * Array list of ActivationSpecs
52      */

53     private ArrayList JavaDoc activationSpecs = new ArrayList JavaDoc();
54
55     /**
56      * Constructor
57      * @param objectName String of object name
58      */

59     public JCAResource(String JavaDoc objectName) {
60         super(objectName);
61     }
62
63     /**
64      * Get the Activationspec names
65      * @return String [] list of Activationspec names
66      */

67     public String JavaDoc [] getActivationSpecs() {
68 // return activationSpecs;
69
return ((String JavaDoc[]) activationSpecs.toArray(new String JavaDoc[activationSpecs.size()]));
70     }
71
72     /**
73      * Get the AdminObject names
74      * @return String [] list of AdminObject names
75      */

76     public String JavaDoc [] getAdminObjects() {
77 // return adminObjects;
78
return ((String JavaDoc[]) adminObjects.toArray(new String JavaDoc[adminObjects.size()]));
79     }
80
81     /**
82      * get the ConnectionFactory names
83      * @return String [] list of ConnectionFactory names
84      */

85     public String JavaDoc [] getConnectionFactories() {
86 // return connectionFactories;
87
return ((String JavaDoc[]) connectionFactories.toArray(new String JavaDoc[connectionFactories.size()]));
88     }
89
90     /**
91      * set the AdminObject name
92      * @param adminObjectName String of AdminObject name
93      */

94     public void setAdminObjects(String JavaDoc adminObjectName) {
95         adminObjects.add(adminObjectName);
96     }
97
98     /**
99      * set the ActivationSpec name
100      * @param activationSpecsObjectName String of activationSpecs name
101      */

102     public void setActivationSpecs(String JavaDoc activationSpecsObjectName) {
103         activationSpecs.add(activationSpecsObjectName);
104     }
105     /**
106      * set the ConnectionFactory name
107      * @param connectionFactoryObjectName String of ConnectionFactory name
108      */

109     public void setConnectionFactory(String JavaDoc connectionFactoryObjectName) {
110         connectionFactories.add(connectionFactoryObjectName);
111     }
112 }
113
Popular Tags