org.instrumentmiddleware.cima.session.impl
Class SessionManager

java.lang.Object
  extended by org.instrumentmiddleware.cima.session.impl.SessionManager
All Implemented Interfaces:
ISessionManager, org.springframework.context.ApplicationEventPublisherAware

public class SessionManager
extends java.lang.Object
implements ISessionManager

This ISessionManager implementation maintains two Maps of sessions to allow for quicker lookups.

Author:
andrew

Constructor Summary
SessionManager(IPluginManager pluginManager)
           
 
Method Summary
 void addSession(ISession session)
           
 IRegisteredParcel createRegisteredParcel(IPlugin plugin, org.instrumentmiddleware.cima.parcel.ParcelDocument.Parcel parcel)
          create a parcel that knows who it needs to be delivered to
 ISession createSession(ICIMAPlugin plugin, org.instrumentmiddleware.cima.parcel.EntityType recipient)
          Create a new session.
 ISession createSession(java.lang.String sessionId, ICIMAPlugin plugin, org.instrumentmiddleware.cima.parcel.EntityType recipient)
          Create a new session.
 ISession getSession(java.lang.String sessionId)
          retrieve a single session given the id
 java.util.List<ISession> getSessions(IPlugin key)
          Retrieve the sessions belonging to the plugin.
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
 ISession removeSession(java.lang.String sessionId)
           
 void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionManager

public SessionManager(IPluginManager pluginManager)
               throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setApplicationEventPublisher

public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
Specified by:
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware

createRegisteredParcel

public IRegisteredParcel createRegisteredParcel(IPlugin plugin,
                                                org.instrumentmiddleware.cima.parcel.ParcelDocument.Parcel parcel)
Description copied from interface: ISessionManager
create a parcel that knows who it needs to be delivered to

Specified by:
createRegisteredParcel in interface ISessionManager
Returns:
the smart parcel

addSession

public void addSession(ISession session)
Specified by:
addSession in interface ISessionManager

getSession

public ISession getSession(java.lang.String sessionId)
retrieve a single session given the id

Specified by:
getSession in interface ISessionManager
Parameters:
sessionId -
Returns:
the session

removeSession

public ISession removeSession(java.lang.String sessionId)
Specified by:
removeSession in interface ISessionManager

getSessions

public java.util.List<ISession> getSessions(IPlugin key)
Retrieve the sessions belonging to the plugin.

Specified by:
getSessions in interface ISessionManager
Parameters:
key -
Returns:
the list of sessions

onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Parameters:
event -
See Also:
ISessionManager}

createSession

public ISession createSession(ICIMAPlugin plugin,
                              org.instrumentmiddleware.cima.parcel.EntityType recipient)
                       throws java.lang.Exception
Create a new session.

Specified by:
createSession in interface ISessionManager
Parameters:
plugin - The local plugin
recipient - The remote entity
Returns:
A new session
Throws:
java.lang.Exception

createSession

public ISession createSession(java.lang.String sessionId,
                              ICIMAPlugin plugin,
                              org.instrumentmiddleware.cima.parcel.EntityType recipient)
                       throws java.lang.Exception
Create a new session.

Specified by:
createSession in interface ISessionManager
Parameters:
sessionId - The session id
plugin - The local plugin
recipient - The remote entity
Returns:
A new session
Throws:
java.lang.Exception


Copyright © 2008. All Rights Reserved.