Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.gateway
Class Gateway  view Gateway download Gateway.java

java.lang.Object
  extended bycom.flexstor.common.gateway.Gateway
All Implemented Interfaces:
com.flexstor.common.constants.EjbHomeInterfacesI
Direct Known Subclasses:
AdmGroupGateway, AdmGroupPersistGateway, AdmUserPersistGateway, ApplicationGateway, AssetPathGateway, AssetRoleListGateway, AssetsInProcessGateway, BucketGateway, CheckInGateway, CheckOutCheckInGateway, CheckOutGateway, CleanupGateway, ContextGateway, DisguiseBucketGateway, DisguiseFieldGateway, DisguiseGateway, DisplayBucketGateway, DisplayFieldGateway, DisplayGateway, DisplayLayoutGateway, EditGateway, EmailAddressGateway, FieldGateway, FileStorageGateway, FtpAddressGateway, GroupGateway, ImportRecordGateway, ImportSettingGateway, InitGateway, LookupGateway, LookupListGateway, MachineGateway, PrivAssetGateway, PrivilegeGateway, PropertyGateway, ReportTemplateGateway, RestrictiveWhereGateway, RoleGateway, SavedSearchGateway, SearchGateway, SearchResultGateway, SendSettingGateway, SequenceGateway, ServerListGateway, SettingsGateway, TransLogGateway, UserGateway, VirDeviceGateway, WorkspaceGateway

public abstract class Gateway
extends java.lang.Object
implements com.flexstor.common.constants.EjbHomeInterfacesI

Core class of the Server Gateway Framework

Version:
3.0

Nested Class Summary
private  class Gateway.HeartbeatManager
          Manages heartbeats for all instances of the server gateway framework.
 
Field Summary
protected static boolean bInitialized
          True if the gateway framework has been initialized
protected static boolean bLoadObjects
           
protected static boolean bSaveObjects
          Debug objects
protected static com.flexstor.common.gateway.engine.GatewayEngineI engine
          Refrence to the current engine
private static Gateway.HeartbeatManager heartbeat
           
private static long nBeatDuration
          Manages gateway heartbeats.
protected static com.flexstor.common.gateway.debug.GatewayDebugUtil util
           
 
Fields inherited from interface com.flexstor.common.constants.EjbHomeInterfacesI
ADDRESS_HOME, APPLICATION_HOME, ASSET_PATH_HOME, ASSET_ROLE_LIST_HOME, ASSETS_COPY_SOURCE_HOME, ASSETS_IN_PROCESS_HOME, BUCKET_PERSIST_HOME, CART_HOME, CHECK_IN_CHECK_OUT_HOME, CHECKIN_HOME, CHECKOUT_HOME, CONTEXT_HOME, DELETE_HOME, DISGUISE_BUCKET_PERSIST_HOME, DISGUISE_FIELD_PERSIST_HOME, DISGUISE_HOME, DISPLAY_BUCKET_PERSIST_HOME, DISPLAY_FIELD_PERSIST_HOME, DISPLAY_HOME, DISPLAY_LAYOUT_PERSIST_HOME, EDIT_PERSIST_HOME, EMAIL_PERSIST_HOME, FIELD_PERSIST_HOME, FILE_STORAGE_HOME, FTP_PERSIST_HOME, GROUP_HOME, GROUP_PERSIST_HOME, IDENTIFIER, IMPORT_RECORD_HOME, IMPORT_SETTING_HOME, INSERT_HOME, LOOKUP_HOME, LOOKUPLIST_HOME, MACHINE_HOME, PICTURE_GALLERY_TEMPLATE_HOME, PING_HOME, PRIV_ASSET_HOME, PRIVILEGE_PERSIST_HOME, PROPERTY_PERSIST_HOME, REPORT_TEMPLATE_HOME, ROLE_HOME, SAVED_SEARCH_HOME, SEARCH_HOME, SEARCH_RESULT_HOME, SEND_SETTING_HOME, SEQUENCE_HOME, SERVER_LIST_HOME, SETTINGS_HOME, TRANSACTION_LOG_HOME, UPDATE_HOME, USER_HOME, USER_PERSIST_HOME, VIR_DEVICE_HOME, WHERE_PERSIST_HOME, WORKSPACE_HOME
 
Constructor Summary
Gateway()
           
 
Method Summary
 void beginHeartbeats()
          Starts sending heartbeats to the EJB server for the specified object.
protected  com.flexstor.common.gateway.exceptions.TransactionFailedException buildException(java.lang.Throwable e)
          Reformats the given exception to a TransactionFailedException.
protected  com.flexstor.common.gateway.exceptions.TransactionFailedException buildException(java.lang.Throwable e, java.lang.String sSourceModule, java.lang.String sClassIdentifier)
          Reformats the given exception to a TransactionFailedException.
protected  boolean canLoadObject()
          Returns true if object loading is on.
protected  boolean canSaveObject()
          Returns true if object saving is on.
 void dispose()
          Cleans up the gateway.
 java.lang.String EBJObjectToString(com.flexstor.ejb.EjbObject o)
          Converts an ROEJBObject reference to a String and limits it to 100 characters.
static void enableDebugging(java.lang.String sBasePath, boolean bSave, boolean bLoad)
          Enables debugging (serialization of objects to files).
protected abstract  com.flexstor.ejb.EjbObject getBeanObject()
          Returns the instance of the current bean, or null if the bean has not been created.
protected  com.flexstor.ejb.EjbHome getHome()
          Returns the home interface for the specified published name.
protected abstract  java.lang.String getHomeName()
          Returns the name of the home interface.
static boolean isInitalized()
          Checks to see if the gateway framework has been properly initialized.
protected  java.lang.Object retrieveObject(java.lang.String sName)
          Loads an object from a file.
protected  void shutdown()
          Shuts down the gatway framework by stopping the heartbeat thread and closing all open JNDI contexts.
protected  void storeObject(java.lang.String sName, java.lang.Object o)
          Stores an object to a file.
protected  void storeObject(java.lang.String sName, java.lang.Object o, boolean bUpdate)
          Stores an object to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

protected static com.flexstor.common.gateway.engine.GatewayEngineI engine
Refrence to the current engine


bInitialized

protected static boolean bInitialized
True if the gateway framework has been initialized


bSaveObjects

protected static boolean bSaveObjects
Debug objects


bLoadObjects

protected static boolean bLoadObjects

util

protected static com.flexstor.common.gateway.debug.GatewayDebugUtil util

nBeatDuration

private static long nBeatDuration
Manages gateway heartbeats.


heartbeat

private static Gateway.HeartbeatManager heartbeat
Constructor Detail

Gateway

public Gateway()
Method Detail

getHomeName

protected abstract java.lang.String getHomeName()
Returns the name of the home interface.


getBeanObject

protected abstract com.flexstor.ejb.EjbObject getBeanObject()
Returns the instance of the current bean, or null if the bean has not been created.


isInitalized

public static boolean isInitalized()
Checks to see if the gateway framework has been properly initialized.


getHome

protected com.flexstor.ejb.EjbHome getHome()
                                    throws java.lang.Exception
Returns the home interface for the specified published name.


buildException

protected com.flexstor.common.gateway.exceptions.TransactionFailedException buildException(java.lang.Throwable e)
Reformats the given exception to a TransactionFailedException. This method also performs error logging, so it is important that this method be called whenever an incoming exception occurs.


buildException

protected com.flexstor.common.gateway.exceptions.TransactionFailedException buildException(java.lang.Throwable e,
                                                                                           java.lang.String sSourceModule,
                                                                                           java.lang.String sClassIdentifier)
Reformats the given exception to a TransactionFailedException. This method also performs error logging, so it is important that this method be called whenever an incoming exception occurs.


shutdown

protected void shutdown()
Shuts down the gatway framework by stopping the heartbeat thread and closing all open JNDI contexts.


dispose

public void dispose()
Cleans up the gateway. NOTE: This method MUST be called to stop heartbeats from going to the EJB if beginHeartbeats() has been called. NOTE: This methos MUST be called if you wish the server to immediately cleanup (passivate) this EJB.


enableDebugging

public static void enableDebugging(java.lang.String sBasePath,
                                   boolean bSave,
                                   boolean bLoad)
                            throws com.flexstor.common.gateway.exceptions.GatewayInitException
Enables debugging (serialization of objects to files).


canSaveObject

protected boolean canSaveObject()
Returns true if object saving is on.


canLoadObject

protected boolean canLoadObject()
Returns true if object loading is on.


storeObject

protected void storeObject(java.lang.String sName,
                           java.lang.Object o,
                           boolean bUpdate)
                    throws java.lang.Throwable
Stores an object to a file.


storeObject

protected void storeObject(java.lang.String sName,
                           java.lang.Object o)
                    throws java.lang.Throwable
Stores an object to a file.


retrieveObject

protected java.lang.Object retrieveObject(java.lang.String sName)
                                   throws java.lang.Throwable
Loads an object from a file.


EBJObjectToString

public java.lang.String EBJObjectToString(com.flexstor.ejb.EjbObject o)
Converts an ROEJBObject reference to a String and limits it to 100 characters.


beginHeartbeats

public void beginHeartbeats()
Starts sending heartbeats to the EJB server for the specified object. Call dispose() to stop the heartbeats for this bean. This method does not cause the heartbeat to be sent right away. In the worst case it will take the full heartbeat duration (nBeatDuration) before a heartbeat is sent.