On Oct 11, 2013, at 7:46 AM, Dennis Sosnoski <[email protected]> wrote:

> I recently made some changes to support WS-RM operating over 
> WS-SecureConversation. As part of this I needed to do some policy 
> manipulation supported by the EndpointPolicyImpl class but not in the 
> EndpointPolicy interface (which also required PolicyEngineImpl rather than 
> PolicyEngine, and the standard EffectivePolicyImpl rather than a private 
> EffectivePolicyImpl). Anyone see a problem with this? Seems like bad form to 
> be using the Impls outside the module, but it saves a lot of copy/paste code.

Agreed.   Looks like bad form.  I'd much rather see additional methods added to 
the interfaces that may be required and flip as many params to just be the 
interface and not the impl.  (and maybe cast to the impl inside the private 
methods or similar if really required.

In addition, I'm not sure the line:

PolicyEngineImpl engine = manager.getBus().getExtension(PolicyEngineImpl.class);

would even work as expected.  The PolicyEngineImpl is registered as a 
PolicyEngine.class.  Thus, the above call MAY be creating a second one.  Not 
sure.  Something like:

PolicyEngineImpl engine = 
(PolicyEngineImpl)manager.getBus().getExtension(PolicyEngine.class);

would likely be more reliable, but again, I'd promote just adding additional 
methods onto PolicyEngine directly if at all possible.

Dan



> You can view the change at 
> http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=1531258&r1=1531257&r2=1531258&view=diff
>  basically the setPolicies() method
> 
>  - Dennis
> 

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to