JmxResourceAdapter.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  * Initial developer(s): ____________________________________.
00022  * Contributor(s): Michel Bruno and Guillaume Riviere
00023  *
00024  * --------------------------------------------------------------------------
00025  * $Id: JmxResourceAdapter.java,v 1.4 2004/10/29 23:33:37 ehardesty Exp $
00026  * --------------------------------------------------------------------------
00027  */
00028 
00029 package org.objectweb.jonas.resource;
00030 
00031 import java.util.Properties;
00032 import java.io.File;
00033 import java.net.URL;
00034 
00044 public class JmxResourceAdapter implements JmxResourceAdapterMBean {
00045 
00049     private Properties prop = null;
00053     private String jndiname = null;
00057     private String filename = null;
00061     private boolean inEarCase = false;
00065     private URL earURL = null;
00066 
00075     public JmxResourceAdapter(Properties prop, String jndiname, String filename,
00076         boolean inEarCase, URL earURL) {
00077         this.prop = prop;
00078         this.jndiname =  jndiname;
00079         // To avoid trouble between OS (Unix <-> Windows)
00080         try {
00081             this.filename = (new File(filename)).toURL().getPath();
00082         } catch (Exception e) {
00083             this.filename = filename;
00084         }
00085         this.inEarCase = inEarCase;
00086         this.earURL = earURL;
00087     }
00088 
00093     public Properties getProperties() {
00094         return prop;
00095     }
00096 
00101     public String getJndiName() {
00102         return jndiname;
00103     }
00104 
00109     public String getFilename() {
00110         return filename;
00111     }
00112 
00117     public boolean isInEarCase() {
00118         return inEarCase;
00119     }
00120 
00125     public URL getEarURL() {
00126         return earURL;
00127     }
00128 }

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