LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.notifier
Class LyEventNotifier

java.lang.Object
  extended by leon.notifier.LyEventNotifier

public class LyEventNotifier
extends java.lang.Object

This class is used by DataSources to transmit their events to an instance of EventEncoder.

See Also:
LyEventEncoder, LyEventConnection

Nested Class Summary
static class LyEventNotifier.EventType
          Notification types.
 
Field Summary
static java.lang.String __VERSION
           
static java.lang.String CONTEXT_PREFIX
          Prefix for properties in ServletContext
 
Constructor Summary
LyEventNotifier(LyApplication application, LyNotifier notifier)
          Deprecated. replaced by LyEventNotifier(LyApplication application, LyNotifier notifier, Properties properties)
LyEventNotifier(LyApplication application, LyNotifier notifier, java.util.Properties properties)
          Constructor Initialization is done with the init method.
 
Method Summary
 boolean close()
          Close current connection.
 boolean createConnection()
          Create and open a new connection.
 LyApplication getApplication()
          Accessor to the environment.
 LyEventConnection getConnection()
          Accessor to the connection.
 LyEnvironment getEnvironment()
          Accessor to the environment.
 LyEventDecoder getEventDecoder(LyDataSource dataSource)
          Accessor to a valid decoder instance for the specified datasource.
 LyEventEncoder getEventEncoder(LyDataSource dataSource)
          Accessor to a valid encoder instance for the specified datasource.
 java.lang.String getId()
          Shortcut to the notifier id : getNotifier().getId().
 java.lang.String getLocationId()
          To get the id of the associated location.
 LyNotifier getNotifier()
          Accessor to the notifier description (contains parameters read from the meta model).
 java.util.Properties getProperties()
          Accessor to the properties file or parameter if specified in constructor.
 boolean isGroupedEvent()
          Indicates if the notifier is currently notifying a grouped event message : current returns false.
 boolean isReady()
          Checks if notifier is ready or not.
 boolean isXASupported()
          Tests if this notifier supports the XA protocol or not.
 void sendGroupedEvents(java.lang.String groupId)
          To send events for a specified group identifier.
 void setError(java.lang.String message)
          Set an error message : an error occured. and the error description is accessible through this accessor
 void setGroupedEvent(boolean status)
          Indicates if the notifying is currently notifying a grouped event message : internal use only.
 void setLocationId(java.lang.String locationId)
          Internal method to set the locationId for this notifier.
 void sleep()
          Invoked when the application is going on sleeping mode.
 boolean supportsGroupedEvents()
          To know if this notifier supports the grouped events.
 boolean validate(LyInfoList<LyClassInfo> classInfos)
          This method is used to build all the class peers for all the classInfo.
 boolean wakeUp()
          Invoked when the application is going on sleeping mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

CONTEXT_PREFIX

public static java.lang.String CONTEXT_PREFIX
Prefix for properties in ServletContext.*

Constructor Detail

LyEventNotifier

public LyEventNotifier(LyApplication application,
                       LyNotifier notifier)
Deprecated. replaced by LyEventNotifier(LyApplication application, LyNotifier notifier, Properties properties)

Constructor Initialization is done with the init method.

Parameters:
application - the application instance
notifier - contains the description of notification service parameters.

LyEventNotifier

public LyEventNotifier(LyApplication application,
                       LyNotifier notifier,
                       java.util.Properties properties)
Constructor Initialization is done with the init method.

Parameters:
application - the application instance
notifier - contains the description of notification service parameters.
properties - the initialization properties or null if found in a properties file
Method Detail

getProperties

public java.util.Properties getProperties()
Accessor to the properties file or parameter if specified in constructor.

Returns:
the properties.

getLocationId

public java.lang.String getLocationId()
To get the id of the associated location.

Returns:
The id of the associated location.

setError

public void setError(java.lang.String message)
Set an error message : an error occured. and the error description is accessible through this accessor

Parameters:
message - the error message

validate

public boolean validate(LyInfoList<LyClassInfo> classInfos)
This method is used to build all the class peers for all the classInfo. It must be specialized by subclasses. Basically, this method associates the dataProvider with local classes. A class is local if there is no binding.

Parameters:
classInfos - Classes to validate.
Returns:
True if the validation was successful, false otherwise.

close

public boolean close()
Close current connection.

Returns:
true if the operation is successful

createConnection

public boolean createConnection()
Create and open a new connection.

Returns:
true if the operation is successful

sleep

public void sleep()
Invoked when the application is going on sleeping mode.


wakeUp

public boolean wakeUp()
Invoked when the application is going on sleeping mode.


getApplication

public LyApplication getApplication()
Accessor to the environment.

Returns:
the application instance

getEnvironment

public LyEnvironment getEnvironment()
Accessor to the environment.

Returns:
the environment instance

getNotifier

public LyNotifier getNotifier()
Accessor to the notifier description (contains parameters read from the meta model).

Returns:
the notifier instance

getId

public java.lang.String getId()
Shortcut to the notifier id : getNotifier().getId().

Returns:
the notifier is

getConnection

public LyEventConnection getConnection()
Accessor to the connection. Should be implemented by subclasses.

Returns:
the connection instance.

getEventEncoder

public LyEventEncoder getEventEncoder(LyDataSource dataSource)
Accessor to a valid encoder instance for the specified datasource.

Parameters:
dataSource - the dataSource which creates the event
Returns:
current encoder instance

getEventDecoder

public LyEventDecoder getEventDecoder(LyDataSource dataSource)
Accessor to a valid decoder instance for the specified datasource.

Parameters:
dataSource - the dataSource which will handle the event
Returns:
current decoder instance

isXASupported

public boolean isXASupported()
Tests if this notifier supports the XA protocol or not. Subclasses may override this method. The default implementation is to return false.

Returns:
true if this notifier supports the XA protocol, false otherwise.

isGroupedEvent

public boolean isGroupedEvent()
Indicates if the notifier is currently notifying a grouped event message : current returns false. This is used internally to distinguish a load from the notifier and from the application (UnionClass make the distinction for performance issues)

Returns:
notifying status

setGroupedEvent

public void setGroupedEvent(boolean status)
Indicates if the notifying is currently notifying a grouped event message : internal use only. This is used internally to distinguish a load from the notifier and from the application (UnionClass make the distinction for performance issues)

Parameters:
status - notifying status

setLocationId

public void setLocationId(java.lang.String locationId)
Internal method to set the locationId for this notifier.

Parameters:
locationId - The new locationId of this notifier.

supportsGroupedEvents

public boolean supportsGroupedEvents()
To know if this notifier supports the grouped events.

Returns:
true if this notifier supports the grouped events.

sendGroupedEvents

public void sendGroupedEvents(java.lang.String groupId)
To send events for a specified group identifier.

Parameters:
groupId - the group identifier.

isReady

public boolean isReady()
Checks if notifier is ready or not.


(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com