public class SynapseConfiguration extends Object implements ManagedLifecycle, SynapseArtifact
Constructor and Description |
---|
SynapseConfiguration() |
Modifier and Type | Method and Description |
---|---|
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 |
addSynapseImport(String name,
SynapseImport synImport)
Add Synapse Import to a configuration with given name
|
void |
addSynapseLibrary(String name,
Library library)
Add Synapse library to configuration with given name
|
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
|
org.apache.axis2.engine.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
|
Object |
getLocalRegistryEntry(String key)
Get the resource from 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 stores 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 property 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
|
Map<String,SynapseImport> |
getSynapseImports()
Get all Synapse libraries in the Synapse configuration
|
Map<String,Library> |
getSynapseLibraries()
Get all Synapse libraries in the Synapse 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.
|
SynapseImport |
removeSynapseImport(String name)
remove the Synapse library from the synapse configuration
|
Library |
removeSynapseLibrary(String name)
remove the Synapse library from the synapse configuration
|
void |
setAllowHotUpdate(boolean allowHotUpdate) |
void |
setAxisConfiguration(org.apache.axis2.engine.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) |
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 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 Collection<API> getAPIs()
public void removeAPI(String name)
public TemplateMediator getSequenceTemplate(String key)
key
- the key being referenced for the templatepublic Mediator getMandatorySequence()
getSequence(String)
but this method improves the
performance hence this will be required for all messagespublic void setMandatorySequence(Mediator mandatorySequence)
mandatorySequence
- to be set as the direct referencepublic Mediator getSequence(String key)
key
- the key being referencedpublic 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 Map<String,Entry> getCachedEntries()
public Map<String,Entry> getDefinedEntries()
public Object getLocalRegistryEntry(String key)
key
- the key of the resource requiredpublic Object getEntry(String key)
key
- the key of the resource requiredpublic Entry getEntryDefinition(String key)
key
- the key for which the Entry is requiredpublic 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 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 endpointpublic 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 uppublic 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(org.apache.axis2.engine.AxisConfiguration axisConfig)
axisConfig
- AxisConfiguration to be setpublic org.apache.axis2.engine.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 retrievedpublic 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 valuepublic long getProperty(String propKey, long def)
propKey
- - key for the property lookupdef
- - default valuepublic String getProperty(String propKey)
propKey
- - key for the property lookuppublic void init(SynapseEnvironment se)
init
in interface ManagedLifecycle
se
- SynapseEnvironment specifying the env to be initializedpublic void destroy()
destroy
in interface ManagedLifecycle
public 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 executorpublic MessageStore getMessageStore(String name)
name
- Name of the message storepublic 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 storepublic void addMessageProcessor(String name, MessageProcessor processor)
name
- of the Message processorprocessor
- instancepublic Map<String,MessageProcessor> getMessageProcessors()
public MessageProcessor removeMessageProcessor(String name)
name
- of the messagepublic void addSynapseLibrary(String name, Library library)
name
- of synapse liblibrary
- instancepublic Map<String,Library> getSynapseLibraries()
public Library removeSynapseLibrary(String name)
name
- of the libpublic void addSynapseImport(String name, SynapseImport synImport)
name
- of synapse libsynImport
- instancepublic Map<String,SynapseImport> getSynapseImports()
public SynapseImport removeSynapseImport(String name)
name
- of the libpublic 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 removeEndpointTemplate(String name)
public boolean isAllowHotUpdate()
public void setAllowHotUpdate(boolean allowHotUpdate)
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.