ResourceAdapter.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: ResourceAdapter.java,v 1.2 2004/10/29 23:33:37 ehardesty Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.resource;
00027 
00028 import java.util.Properties;
00029 import java.io.File;
00030 import java.net.URL;
00031 
00032 import org.objectweb.jonas.management.j2eemanagement.J2EEManagedObject;
00033 
00041 public class ResourceAdapter extends J2EEManagedObject {
00042 
00043     // JSR 77
00047     private String jcaResourceObjectName = null;
00048 
00052     private Properties prop = null;
00056     private String jndiname = null;
00060     private String filename = null;
00064     private boolean inEarCase = false;
00068     private URL earURL = null;
00069 
00079     public ResourceAdapter(String objectName, Properties prop, String jndiname, String filename,
00080                            boolean inEarCase, URL earURL) {
00081         super(objectName);
00082         this.prop = prop;
00083         this.jndiname =  jndiname;
00084         // To avoid trouble between OS (Unix <-> Windows)
00085         try {
00086             this.filename = (new File(filename)).toURL().getPath();
00087         } catch (Exception e) {
00088             this.filename = filename;
00089         }
00090         this.inEarCase = inEarCase;
00091         this.earURL = earURL;
00092     }
00093 
00098     public Properties getProperties() {
00099         return prop;
00100     }
00101 
00106     public String getJndiName() {
00107         return jndiname;
00108     }
00109 
00114     public String getFileName() {
00115         return filename;
00116     }
00117 
00122     public boolean getInEarCase() {
00123         return inEarCase;
00124     }
00125 
00130     public URL getEarURL() {
00131         return earURL;
00132     }
00133 
00138     public String getJcaResource() {
00139         return jcaResourceObjectName;
00140     }
00141 
00146     public void setJcaResource(String jcaResourceObjectName) {
00147         this.jcaResourceObjectName = jcaResourceObjectName;
00148     }
00149 }

Generated on Tue Feb 15 15:05:20 2005 for JOnAS by  doxygen 1.3.9.1