net.agmodel.resBean
Class ResourceBean

java.lang.Object
  |
  +--net.agmodel.utilBean.ServerBean
        |
        +--net.agmodel.resBean.ResourceBean
All Implemented Interfaces:
EventListener, Serializable, ServiceBeanListener

public class ResourceBean
extends ServerBean
implements ServiceBeanListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class net.agmodel.utilBean.ServerBean
ServerBean.ConnectThreadEJBHTTP, ServerBean.ConnectThreadHTTP, ServerBean.ConnectThreadRMIHTTP
 
Field Summary
 
Fields inherited from class net.agmodel.utilBean.ServerBean
serverHTTP, serverRMI, sessionID
 
Constructor Summary
ResourceBean()
           
 
Method Summary
protected  void disconnect()
          If the services is a Server, then connects and returns a sessionID.
protected  ServerHTTP getHTTPObject()
           
 ResItem getResItem(String fileSetID, String key)
           
 ResItem[] getResItems(String fileSetID, String[] keys)
           
protected  void getRMIConnection()
          If the services is a Server, then connects and returns a sessionID.
 String getRMIName()
          Return the name the server registers itself by in RMIRegistry.
protected  Thread getServiceFinderThread()
          Returns a thread object which can find a reference to the service, and in the case of Servers establish a connection to the broker, through whichever mechanisms are available.
 String getSessionID()
           
 ResItem getText(String fileSetID, String key)
           
 UserFileSet getUserFileSet(String fileSetID)
           
protected  boolean isEJB()
           
protected  boolean isStateful()
           
 String[] listFileSet()
           
protected  Remote narrowEJBHomeReference(Object obj)
           
 void newConnection(ServiceBeanEvent evt)
          Called when a ServerBean establishes a connection to a server
 void registerComponent(Component comp, String fileSetID, String key)
           
 void registerTab(JTabbedPane tab, int index, String fileSetID, String key)
           
 void setComponents()
           
 void setRBListener(ResourceBeanListener listener)
           
 
Methods inherited from class net.agmodel.utilBean.ServerBean
addServiceBeanListener, createEJB, finalize, fireServiceBeanEvent, getClientInfo, getHTTPHost, getHTTPHostParamName, getHTTPPort, getHTTPPortParamName, getLanguage, getRMIHost, getRMIHostParamName, isLive, removeServiceBeanListener, setClientInfo, setHTTPHost, setHTTPPort, setLanguage, setLive, setRMIHost, setUpBean
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBean

public ResourceBean()
Method Detail

setRBListener

public void setRBListener(ResourceBeanListener listener)

getRMIName

public String getRMIName()
Description copied from class: ServerBean
Return the name the server registers itself by in RMIRegistry.
Also used as the stem of applet parameters.

Specified by:
getRMIName in class ServerBean
Returns:
a short identifier for the server, usually stored as a constant in the corresponding RMI interface.

getHTTPObject

protected ServerHTTP getHTTPObject()
Specified by:
getHTTPObject in class ServerBean

getSessionID

public String getSessionID()

registerComponent

public void registerComponent(Component comp,
                              String fileSetID,
                              String key)

registerTab

public void registerTab(JTabbedPane tab,
                        int index,
                        String fileSetID,
                        String key)

setComponents

public void setComponents()

getText

public ResItem getText(String fileSetID,
                       String key)

getResItem

public ResItem getResItem(String fileSetID,
                          String key)
                   throws GeneralException
GeneralException

getResItems

public ResItem[] getResItems(String fileSetID,
                             String[] keys)
                      throws GeneralException
GeneralException

listFileSet

public String[] listFileSet()
                     throws GeneralException
GeneralException

getUserFileSet

public UserFileSet getUserFileSet(String fileSetID)

newConnection

public void newConnection(ServiceBeanEvent evt)
Description copied from interface: ServiceBeanListener
Called when a ServerBean establishes a connection to a server

Specified by:
newConnection in interface ServiceBeanListener
Parameters:
evt - contact details for the server.

getServiceFinderThread

protected Thread getServiceFinderThread()
Description copied from class: ServerBean
Returns a thread object which can find a reference to the service, and in the case of Servers establish a connection to the broker, through whichever mechanisms are available.
This thread must call fireServerBeanEvent when the connection is established.
This method is called by setLive(true).
A thread is used, because searching for the way to talk to a broker can take a while, and the application should not block while this is happening. It allows multiple beans to find brokers at the same time.

Specified by:
getServiceFinderThread in class ServerBean
Returns:
a thread, not yet started.

getRMIConnection

protected void getRMIConnection()
                         throws GeneralException,
                                RemoteException
If the services is a Server, then connects and returns a sessionID.
Otherwise does nothing.
This method is normally called, if necessary, by the connect thread

Specified by:
getRMIConnection in class ServerBean
GeneralException
RemoteException

disconnect

protected void disconnect()
If the services is a Server, then connects and returns a sessionID. Otherwise does nothing. This method is called by setLive(false)

Specified by:
disconnect in class ServerBean

isStateful

protected boolean isStateful()
Specified by:
isStateful in class ServerBean

isEJB

protected boolean isEJB()
Specified by:
isEJB in class ServerBean

narrowEJBHomeReference

protected Remote narrowEJBHomeReference(Object obj)