KickJava   Java API By Example, From Geeks To Geeks.

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


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: ResourceAdapterModule.java,v 1.3 2004/03/22 13:38:54 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

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

38 public class ResourceAdapterModule extends J2EEModule /*J2EEManagedObject*/ {
39
40     // JSR 77
41
private ArrayList JavaDoc resourceAdapters = new ArrayList JavaDoc();
42
43     private boolean inEarCase = false;
44     private URL JavaDoc earURL = null;
45     private String JavaDoc fileName = null;
46
47     public ResourceAdapterModule(String JavaDoc objectName, boolean inEarCase, URL JavaDoc earURL) {
48         super(objectName);
49         this.inEarCase = inEarCase;
50         this.earURL = earURL;
51     }
52
53     /**
54      * Accessor the flag indicating if the resource adapter is in Ear.
55      * @return Flag if this resource adapter is in Ear
56      */

57     public boolean getInEarCase() {
58         return inEarCase;
59     }
60
61     /**
62      * Accessor the URL of the Ear if the resource adapter is in Ear.
63      * @return The URL of the Ear or null
64      */

65     public URL JavaDoc getEarURL() {
66         return earURL;
67     }
68
69     public String JavaDoc[] getResourceAdapters() {
70         return ((String JavaDoc[]) resourceAdapters.toArray(new String JavaDoc[resourceAdapters.size()]));
71     }
72
73     public void setResourceAdapter(String JavaDoc resourceAdapterObjectName) {
74         resourceAdapters.add(resourceAdapterObjectName);
75     }
76     /**
77      * @return Returns the fileName.
78      */

79     public String JavaDoc getFileName() {
80         return fileName;
81     }
82     /**
83      * @param fileName The fileName to set.
84      */

85     public void setFileName(String JavaDoc fileName) {
86         this.fileName = fileName;
87     }
88 }
89
Popular Tags