-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Enhanced with ability to add advice to ProxyFactory - http://forum.sprin... #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,16 +35,30 @@ public class JaxWsPortProxyFactoryBean extends JaxWsPortClientInterceptor | |
implements FactoryBean<Object> { | ||
|
||
private Object serviceProxy; | ||
|
||
private List<Advice> adviceList; | ||
|
||
|
||
public addAdvice(Advice advice){ | ||
|
||
if(adviceList == null){ | ||
adviceList = new ArrayList<Advice>(); | ||
} | ||
adviceList.add(advice); | ||
} | ||
|
||
@Override | ||
public void afterPropertiesSet() { | ||
super.afterPropertiesSet(); | ||
|
||
// Build a proxy that also exposes the JAX-WS BindingProvider interface. | ||
ProxyFactory pf = new ProxyFactory(); | ||
ProxyFactory pf = new ProxyFactory(this); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified to pass the self reference to the constructor, for setting the target source |
||
pf.addInterface(getServiceInterface()); | ||
pf.addInterface(BindingProvider.class); | ||
if(adviceList != null ){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding all the custom advices to the ProxyFactory bean |
||
for(Advice advice : adviceList){ | ||
pf.addAdvice(advice); | ||
} | ||
} | ||
pf.addAdvice(this); | ||
this.serviceProxy = pf.getProxy(getBeanClassLoader()); | ||
} | ||
|
@@ -64,5 +78,12 @@ public Class<?> getObjectType() { | |
public boolean isSingleton() { | ||
return true; | ||
} | ||
|
||
|
||
public void setAdviceList(List<Advice> adviceList){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setter method to set advice list |
||
this.adviceList = adviceList; | ||
} | ||
|
||
public List<Advice> getAdviceList(){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Getter method to get the advice list |
||
return adviceList; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To externalize the ability to add single custom advice