KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > modules > AbstractModule


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.core.modules;
10
11 import javax.naming.InitialContext JavaDoc;
12
13 import org.jboss.naming.NonSerializableFactory;
14 import org.jboss.portal.server.util.Service;
15
16 /**
17  * Base class for modules. Provides JNDI facilities.
18  *
19  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
20  * @version $Revision: 1.2 $
21  */

22 public class AbstractModule extends Service
23 {
24
25    protected String JavaDoc JNDIName;
26
27   /**
28    * @jmx.managed-attribute
29    */

30   public String JavaDoc getJNDIName()
31   {
32      return JNDIName;
33   }
34
35   /**
36    * @jmx.managed-attribute
37    */

38   public void setJNDIName(String JavaDoc JNDIName)
39   {
40      this.JNDIName = JNDIName;
41   }
42
43   protected void startService() throws Exception JavaDoc
44   {
45      NonSerializableFactory.rebind(new InitialContext JavaDoc(), JNDIName, this);
46   }
47
48   public void stopService() throws Exception JavaDoc
49   {
50      NonSerializableFactory.unbind(JNDIName);
51   }
52 }
53
Popular Tags