[ 
https://issues.apache.org/jira/browse/SYNAPSE-382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609423#action_12609423
 ] 

Ruwan Linton commented on SYNAPSE-382:
--------------------------------------

I was also having the same problem and used the above defined approach to get 
the SynapseConfiguration. But I must say that there is a reason why this has 
not been exposed to the outsiders.

When you are calling the init methods of mediators (for instance) the Synapse 
Configuration is not fully built. For example if you have 4 sequences in the 
configuration while building the first sequence the rest of the three sequences 
are not registered with the SynapseConfiguration. So I would say we enable this 
(I mean give the accessors) but this has to be used with care, specially on the 
init methods. 

Any way, there is no point in hiding this because the above described approach 
by andreas, gives the access to it but it is just ugly to get the access to 
SynapseConfiguration in that way.

> Provide access to SynapseConfiguration and ConfigurationContext through 
> SynapseEnvironment
> ------------------------------------------------------------------------------------------
>
>                 Key: SYNAPSE-382
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-382
>             Project: Synapse
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.2
>         Environment: N/A
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> When the init method on a Startup (or any other object implementing 
> ManagedLifecycle) is called it receives only a reference to the 
> SynapseEnvironment. From there it is not possible to directly retrieve the 
> corresponding SynapseConfiguration object. Neither it is possible to easily 
> get access to Axis2's ConfigurationContext (assuming that the 
> SynapseEnvironment implementation is Axis2SynapseEnvironment). However it is 
> possible to get references to these two objects by creating a new 
> MessageContext:
> for SynapseConfiguration: synEnv.createMessageContext().getConfiguration()
> for ConfigurationContext: 
> ((Axis2MessageContext)synEnv.createMessageContext()).getAxis2MessageContext().getConfigurationContext()
> If using that workaround it is possible to get the SynapseConfiguration and 
> ConfigurationContext from a (Axis2)SynapseEnvironment anyway, then there is 
> no reason to hide these objects and we should expose them cleanly by adding a 
> getSynapseConfiguration() method to SynapseEnvironment and a 
> getConfigurationContext() method to Axis2SynapseEnvironment.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to