|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.synapse.config.SynapseConfiguration
public class SynapseConfiguration
The SynapseConfiguration holds the global configuration for a Synapse instance.
Constructor Summary | |
---|---|
SynapseConfiguration()
|
Method Summary | |
---|---|
void |
addAPI(String name,
API api)
|
void |
addEndpoint(String key,
Endpoint endpoint)
Define a named endpoint with the given key. |
void |
addEndpoint(String key,
Entry entry)
Deprecated. |
void |
addEndpointTemplate(String name,
Template template)
|
void |
addEntry(String key,
Entry entry)
Define a resource to the local registry. |
void |
addEventSource(String name,
SynapseEventSource eventSource)
Add an event source to the configuration. |
void |
addMessageProcessor(String name,
MessageProcessor processor)
Add message processor to the synapse configuration with given name |
void |
addMessageStore(String name,
MessageStore messageStore)
Add MessageStore to the configuration with a given name. |
void |
addPriorityExecutor(String name,
PriorityExecutor executor)
Add an executor |
void |
addProxyService(String name,
ProxyService proxy)
Add a Proxy service to the configuration. |
void |
addSequence(String key,
Entry entry)
Deprecated. |
void |
addSequence(String key,
Mediator mediator)
Add a named sequence into the local registry. |
void |
addSequenceTemplate(String key,
TemplateMediator mediator)
Add a sequence-template into the local registry. |
void |
addStartup(Startup startup)
Add a startup to the startups map in the configuration. |
void |
clearCache()
Clears the cache of all the remote entries which has been cached in the configuration |
void |
clearCachedEntry(String key)
Clears the cache of the remote entry with the key specified |
void |
destroy()
This method will be called on the soft shutdown or destroying the configuration and will destroy all the stateful managed parts of the configuration. |
API |
getAPI(String name)
|
Collection<API> |
getAPIs()
|
SynapseArtifactDeploymentStore |
getArtifactDeploymentStore()
Get the SynapseArtifactDeploymentStore which is used to store the information about the deployed artifacts |
AxisConfiguration |
getAxisConfiguration()
Get the Axis2 AxisConfiguration for the SynapseConfiguration |
Map<String,Entry> |
getCachedEntries()
Gives the set of remote entries that are cached in localRegistry as mapping of entry key to the Entry definition |
QName |
getDefaultQName()
Get the default QName of the configuration. |
Map<String,Endpoint> |
getDefinedEndpoints()
Returns the map of defined endpoints in the configuration excluding the fetched endpoints from remote registry |
Map<String,Entry> |
getDefinedEntries()
Returns the map of defined entries in the configuration excluding the fetched entries from remote registry. |
Map<String,SequenceMediator> |
getDefinedSequences()
Returns the map of defined sequences in the configuration excluding the fetched sequences from remote registry. |
String |
getDescription()
Gets the configuration description |
Endpoint |
getEndpoint(String key)
Get the definition of the endpoint with the given key |
Template |
getEndpointTemplate(String key)
|
Map<String,Template> |
getEndpointTemplates()
Returns the map of defined synapse endpoint templates in the configuration excluding the fetched sequences from remote registry. |
Object |
getEntry(String key)
Get the resource with the given key |
Entry |
getEntryDefinition(String key)
Get the Entry object mapped to the given key |
SynapseEventSource |
getEventSource(String name)
|
Collection<SynapseEventSource> |
getEventSources()
|
Mediator |
getFaultSequence()
Return the fault sequence to be executed when Synapse encounters a fault scenario during processing |
Map |
getLocalRegistry()
Return an unmodifiable copy of the local registry |
Mediator |
getMainSequence()
Return the main/default sequence to be executed. |
Mediator |
getMandatorySequence()
Gets the mandatory sequence, from the direct reference. |
Map<String,MessageProcessor> |
getMessageProcessors()
Get all Message processors in the Synapse configuration |
MessageStore |
getMessageStore(String name)
Get the Message store for the configuration with a given name. |
Map<String,MessageStore> |
getMessageStores()
Get Message sotres defined |
List<SynapseObserver> |
getObservers()
|
String |
getPathToConfigFile()
The path to the currently loaded configuration file |
Map<String,PriorityExecutor> |
getPriorityExecutors()
Get the executors map |
Properties |
getProperties()
Gets the properties to configure the Synapse environment. |
String |
getProperty(String propKey)
Gets the propety value if the property specified by the propKey is there or null else |
long |
getProperty(String propKey,
long def)
Gets the String representation of the property value if there is a property for the given propKey or returns the default value passed |
String |
getProperty(String propKey,
String def)
Gets the String representation of the property value if there is a property for the given propKey or returns the default value passed |
ProxyService |
getProxyService(String name)
Get the Proxy service with the given name |
Collection<ProxyService> |
getProxyServices()
Return the list of defined proxy services |
Registry |
getRegistry()
Get the remote registry defined (if any) |
Mediator |
getSequence(String key)
Return the sequence specified with the given key |
TemplateMediator |
getSequenceTemplate(String key)
Return the template specified with the given key |
Map<String,TemplateMediator> |
getSequenceTemplates()
Returns the map of defined synapse templates in the configuration excluding the fetched sequences from remote registry. |
Startup |
getStartup(String id)
Get the Startup with the specified name |
Collection<Startup> |
getStartups()
Get the startup collection in the configuration |
Timer |
getSynapseTimer()
Get the timer object for the Synapse Configuration |
void |
init(SynapseEnvironment se)
This method will be called in the startup of Synapse or in an initiation and will initialize all the managed parts of the Synapse Configuration |
boolean |
isAllowHotUpdate()
|
void |
registerObserver(SynapseObserver o)
|
void |
removeAPI(String name)
|
void |
removeEndpoint(String key)
Deletes the endpoint with the given key. |
void |
removeEndpointTemplate(String name)
|
void |
removeEntry(String key)
Deletes any reference mapped to the given key from the local registry |
void |
removeEventSource(String name)
Remove an event source from the configuration. |
PriorityExecutor |
removeExecutor(String name)
Removes an executor from the configuration |
MessageProcessor |
removeMessageProcessor(String name)
remove the message processor from the synapse configuration |
MessageStore |
removeMessageStore(String name)
Removes a Message store from the configuration |
void |
removeProxyService(String name)
Deletes the Proxy Service named with the given name. |
void |
removeSequence(String key)
Removes a sequence from the local registry |
void |
removeSequenceTemplate(String name)
Removes a template from the local registry |
void |
removeStartup(String name)
Removes the startup specified by the name. |
void |
setAllowHotUpdate(boolean allowHotUpdate)
|
void |
setAxisConfiguration(AxisConfiguration axisConfig)
Set the Axis2 AxisConfiguration to the SynapseConfiguration |
void |
setDefaultQName(QName defaultQName)
Set the default QName of the Synapse Configuration |
void |
setDescription(String description)
Sets the description of the configuration |
void |
setEventSources(Map<String,SynapseEventSource> eventSources)
|
void |
setMandatorySequence(Mediator mandatorySequence)
Sets the mandatory sequence direct reference |
void |
setPathToConfigFile(String pathToConfigFile)
Set the path to the loaded synapse.xml |
void |
setProperties(Properties properties)
Deprecated. |
void |
setProperty(String key,
String value)
Sets the specified property to the Synapse configuration |
void |
setRegistry(Registry registry)
Set the remote registry for the configuration |
void |
updateAPI(String name,
API api)
|
void |
updateEndpoint(String key,
Endpoint endpoint)
|
void |
updateEndpointTemplate(String name,
Template template)
|
void |
updateEntry(String key,
Entry entry)
|
void |
updatePriorityExecutor(String name,
PriorityExecutor executor)
|
void |
updateSequence(String key,
Mediator mediator)
|
void |
updateSequenceTemplate(String key,
TemplateMediator mediator)
Update a sequence-template into the local registry. |
void |
updateStartup(Startup startup)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynapseConfiguration()
Method Detail |
---|
public void addSequence(String key, Mediator mediator)
key
- the name for the sequencemediator
- a Sequence mediatorpublic void addSequenceTemplate(String key, TemplateMediator mediator)
key
- the name for the sequencemediator
- a Sequence mediatorpublic void updateSequenceTemplate(String key, TemplateMediator mediator)
key
- the name for the sequencemediator
- a Sequence mediatorpublic void updateSequence(String key, Mediator mediator)
public void addSequence(String key, Entry entry)
key
- the key to lookup the sequence from the remote registryentry
- the Entry object which holds meta information and the cached
resourcepublic Map<String,SequenceMediator> getDefinedSequences()
public Map<String,TemplateMediator> getSequenceTemplates()
public Map<String,Template> getEndpointTemplates()
public void addAPI(String name, API api)
public void updateAPI(String name, API api)
public Collection<API> getAPIs()
public API getAPI(String name)
public void removeAPI(String name)
public TemplateMediator getSequenceTemplate(String key)
key
- the key being referenced for the template
public Mediator getMandatorySequence()
getSequence(String)
but this method improves the
performance hence this will be required for all messages
public void setMandatorySequence(Mediator mandatorySequence)
mandatorySequence
- to be set as the direct referencepublic Mediator getSequence(String key)
key
- the key being referenced
public void removeSequence(String key)
key
- of the sequence to be removedpublic void removeSequenceTemplate(String name)
name
- of the template to be removedpublic Mediator getMainSequence()
public Mediator getFaultSequence()
public void addEntry(String key, Entry entry)
key
- the key associated with the resourceentry
- the Entry that holds meta information about the resource and
its contents (or cached contents if the Entry refers to a
dynamic resource off a remote registry)public void updateEntry(String key, Entry entry)
public Map<String,Entry> getCachedEntries()
public Map<String,Entry> getDefinedEntries()
public Object getEntry(String key)
key
- the key of the resource required
public Entry getEntryDefinition(String key)
key
- the key for which the Entry is required
public void removeEntry(String key)
key
- the key of the reference to be removedpublic void clearCachedEntry(String key)
key
- - String key of the entrypublic void clearCache()
public void addEndpoint(String key, Endpoint endpoint)
key
- the key for the endpointendpoint
- the endpoint definitionpublic void updateEndpoint(String key, Endpoint endpoint)
public void addEndpoint(String key, Entry entry)
key
- the key for the endpoint definitionentry
- the actual endpoint definition to be addedpublic Map<String,Endpoint> getDefinedEndpoints()
public Endpoint getEndpoint(String key)
key
- the key of the endpoint
public void removeEndpoint(String key)
key
- of the endpoint to be deletedpublic void addProxyService(String name, ProxyService proxy)
name
- the name of the Proxy serviceproxy
- the Proxy service instancepublic ProxyService getProxyService(String name)
name
- the name being looked up
public void removeProxyService(String name)
name
- of the Proxy Service to be deletedpublic Collection<ProxyService> getProxyServices()
public Map getLocalRegistry()
public Registry getRegistry()
public void setRegistry(Registry registry)
registry
- the remote registry for the configurationpublic void setAxisConfiguration(AxisConfiguration axisConfig)
axisConfig
- AxisConfiguration to be setpublic AxisConfiguration getAxisConfiguration()
public String getPathToConfigFile()
public void setPathToConfigFile(String pathToConfigFile)
pathToConfigFile
- path to the synapse.xml loadedpublic void setDefaultQName(QName defaultQName)
defaultQName
- QName specifying the default QName of the configurationpublic QName getDefaultQName()
public Timer getSynapseTimer()
public Collection<Startup> getStartups()
public Startup getStartup(String id)
id
- - String name of the startup to be retrieved
public void addStartup(Startup startup)
startup
- - Startup object to be addedpublic void updateStartup(Startup startup)
public void removeStartup(String name)
name
- - name of the startup that needs to be removedpublic Properties getProperties()
public void setProperty(String key, String value)
key
- Name of the propertyvalue
- Value of the property to be setpublic void setProperties(Properties properties)
properties
- - Properties which needs to be setpublic String getProperty(String propKey, String def)
propKey
- - key for the property lookupdef
- - default value
public long getProperty(String propKey, long def)
propKey
- - key for the property lookupdef
- - default value
public String getProperty(String propKey)
propKey
- - key for the property lookup
public void destroy()
destroy
in interface ManagedLifecycle
public void init(SynapseEnvironment se)
init
in interface ManagedLifecycle
se
- SynapseEnvironment specifying the env to be initializedpublic void addEventSource(String name, SynapseEventSource eventSource)
name
- name of the event sourceeventSource
- the event source to be addedpublic SynapseEventSource getEventSource(String name)
public void removeEventSource(String name)
name
- name of the event source to be removedpublic Collection<SynapseEventSource> getEventSources()
public void setEventSources(Map<String,SynapseEventSource> eventSources)
public void registerObserver(SynapseObserver o)
public List<SynapseObserver> getObservers()
public void addPriorityExecutor(String name, PriorityExecutor executor)
name
- name of the executorexecutor
- executorpublic void updatePriorityExecutor(String name, PriorityExecutor executor)
public Map<String,PriorityExecutor> getPriorityExecutors()
public PriorityExecutor removeExecutor(String name)
name
- name of the executor
public MessageStore getMessageStore(String name)
name
- Name of the message store
public void addMessageStore(String name, MessageStore messageStore)
name
- Name of the message storemessageStore
- a MessageStore instancepublic Map<String,MessageStore> getMessageStores()
public MessageStore removeMessageStore(String name)
name
- name of the message store
public void addMessageProcessor(String name, MessageProcessor processor)
name
- of the Message processorprocessor
- instancepublic Map<String,MessageProcessor> getMessageProcessors()
public MessageProcessor removeMessageProcessor(String name)
name
- of the message
public void setDescription(String description)
setDescription
in interface SynapseArtifact
description
- tobe set to the artifactpublic String getDescription()
getDescription
in interface SynapseArtifact
public SynapseArtifactDeploymentStore getArtifactDeploymentStore()
public void addEndpointTemplate(String name, Template template)
public void updateEndpointTemplate(String name, Template template)
public void removeEndpointTemplate(String name)
public Template getEndpointTemplate(String key)
public boolean isAllowHotUpdate()
public void setAllowHotUpdate(boolean allowHotUpdate)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |