org.apache.synapse.message.store
Class AbstractMessageStore

java.lang.Object
  extended by org.apache.synapse.message.store.AbstractMessageStore
All Implemented Interfaces:
ManagedLifecycle, MessageStore, Nameable, SynapseArtifact
Direct Known Subclasses:
InMemoryMessageStore

public abstract class AbstractMessageStore
extends Object
implements MessageStore


Field Summary
protected  String description
          Message Store description
protected  String fileName
          Name of the file where this message store is defined
protected  Lock lock
           
protected  MessageStoreView messageStoreMBean
          Message store JMX view
protected  List<MessageStoreObserver> messageStoreObservers
          List that holds the MessageStore observers registered with the Message Store
protected  String name
          message store name
protected  Map<String,Object> parameters
          Message store parameters
protected  String sequence
          name of the sequence to be executed before storing the message
protected  SynapseConfiguration synapseConfiguration
          synapse configuration reference
protected  SynapseEnvironment synapseEnvironment
          synapse environment reference
 
Constructor Summary
AbstractMessageStore()
           
 
Method Summary
 void destroy()
          This method should implement the destroying of the implemented parts of the configuration.
 String getDescription()
          Retrieves the description of the artifact
 String getFileName()
          get the file name that the message store is configured
 Lock getLock()
           
 String getName()
          Get the name of an abstraction
 Map<String,Object> getParameters()
          get the implementation specific parameters of the Message store
 void init(SynapseEnvironment se)
          This method should implement the initialization of the implemented parts of the configuration.
protected  void notifyMessageAddition(String messageId)
          Notify Message Addition to the observers
protected  void notifyMessageRemoval(String messageId)
          Notify Message removal to the observers
 void registerObserver(MessageStoreObserver observer)
          Register a MessageStore observer instance with the MessageStore to receive events.
 void setDescription(String description)
          Set the description of the artifact
 void setFileName(String filename)
          Set the name of the file that the Message store is configured
 void setName(String name)
          Set the name of an abstraction
 void setParameters(Map<String,Object> parameters)
          set the implementation specific parameters
 int size()
          Returns the number of Messages in this store.
 void unregisterObserver(MessageStoreObserver observer)
          Un register an Message store instance from the message store to stop receiving events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.synapse.message.store.MessageStore
clear, get, get, getAll, offer, peek, poll, remove, remove
 

Field Detail

name

protected String name
message store name


sequence

protected String sequence
name of the sequence to be executed before storing the message


messageStoreMBean

protected MessageStoreView messageStoreMBean
Message store JMX view


synapseConfiguration

protected SynapseConfiguration synapseConfiguration
synapse configuration reference


synapseEnvironment

protected SynapseEnvironment synapseEnvironment
synapse environment reference


parameters

protected Map<String,Object> parameters
Message store parameters


description

protected String description
Message Store description


fileName

protected String fileName
Name of the file where this message store is defined


messageStoreObservers

protected List<MessageStoreObserver> messageStoreObservers
List that holds the MessageStore observers registered with the Message Store


lock

protected Lock lock
Constructor Detail

AbstractMessageStore

public AbstractMessageStore()
Method Detail

init

public void init(SynapseEnvironment se)
Description copied from interface: ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.

Specified by:
init in interface ManagedLifecycle
Parameters:
se - SynapseEnvironment to be used for initialization

getName

public String getName()
Description copied from interface: Nameable
Get the name of an abstraction

Specified by:
getName in interface Nameable
Returns:
String Representation of name

setName

public void setName(String name)
Description copied from interface: Nameable
Set the name of an abstraction

Specified by:
setName in interface Nameable
Parameters:
name - String Representation of name

registerObserver

public void registerObserver(MessageStoreObserver observer)
Description copied from interface: MessageStore
Register a MessageStore observer instance with the MessageStore to receive events.

Specified by:
registerObserver in interface MessageStore
Parameters:
observer - instance to be registered

unregisterObserver

public void unregisterObserver(MessageStoreObserver observer)
Description copied from interface: MessageStore
Un register an Message store instance from the message store to stop receiving events

Specified by:
unregisterObserver in interface MessageStore
Parameters:
observer - instance to be unregistered

notifyMessageAddition

protected void notifyMessageAddition(String messageId)
Notify Message Addition to the observers

Parameters:
messageId - of the Message added.

notifyMessageRemoval

protected void notifyMessageRemoval(String messageId)
Notify Message removal to the observers

Parameters:
messageId - of the Message added

size

public int size()
Description copied from interface: MessageStore
Returns the number of Messages in this store.

Specified by:
size in interface MessageStore
Returns:
the number of Messages in this Store

getParameters

public Map<String,Object> getParameters()
Description copied from interface: MessageStore
get the implementation specific parameters of the Message store

Specified by:
getParameters in interface MessageStore
Returns:
a properties map

setParameters

public void setParameters(Map<String,Object> parameters)
Description copied from interface: MessageStore
set the implementation specific parameters

Specified by:
setParameters in interface MessageStore
Parameters:
parameters - A map of parameters or null

destroy

public void destroy()
Description copied from interface: ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.

Specified by:
destroy in interface ManagedLifecycle

setDescription

public void setDescription(String description)
Description copied from interface: SynapseArtifact
Set the description of the artifact

Specified by:
setDescription in interface SynapseArtifact
Parameters:
description - tobe set to the artifact

getDescription

public String getDescription()
Description copied from interface: SynapseArtifact
Retrieves the description of the artifact

Specified by:
getDescription in interface SynapseArtifact
Returns:
description of the artifact

setFileName

public void setFileName(String filename)
Description copied from interface: MessageStore
Set the name of the file that the Message store is configured

Specified by:
setFileName in interface MessageStore
Parameters:
filename - Name of the file where this artifact is defined

getFileName

public String getFileName()
Description copied from interface: MessageStore
get the file name that the message store is configured

Specified by:
getFileName in interface MessageStore
Returns:
Name of the file where this artifact is defined

getLock

public Lock getLock()


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.