use of org.jboss.wsf.stack.cxf.transport.JBossWSDestinationRegistryImpl in project jbossws-cxf by jbossws.
the class ServerBeanCustomizer method customize.
@Override
public void customize(Object beanInstance) {
if (beanInstance instanceof EndpointImpl) {
configureEndpoint((EndpointImpl) beanInstance);
}
if (beanInstance instanceof ServerFactoryBean) {
ServerFactoryBean factory = (ServerFactoryBean) beanInstance;
if (factory.getInvoker() instanceof JBossWSInvoker) {
((JBossWSInvoker) factory.getInvoker()).setTargetBean(factory.getServiceBean());
}
List<Endpoint> depEndpoints = dep.getService().getEndpoints();
if (depEndpoints != null) {
final String targetBeanName = factory.getServiceBean().getClass().getName();
for (Endpoint depEndpoint : depEndpoints) {
if (depEndpoint.getTargetBeanClass().getName().equals(targetBeanName)) {
depEndpoint.addAttachment(Object.class, factory.getServiceBean());
}
}
}
}
if (beanInstance instanceof ServiceImpl) {
ServiceImpl service = (ServiceImpl) beanInstance;
List<Endpoint> depEndpoints = dep.getService().getEndpoints();
if (depEndpoints != null) {
final Collection<org.apache.cxf.endpoint.Endpoint> eps = service.getEndpoints().values();
for (Endpoint depEp : depEndpoints) {
for (org.apache.cxf.endpoint.Endpoint ep : eps) {
if (ep.getService().getName().equals(depEp.getProperty(Message.WSDL_SERVICE)) && ep.getEndpointInfo().getName().equals(depEp.getProperty(Message.WSDL_PORT)) && ep.getEndpointInfo().getAddress().equals(depEp.getAddress())) {
depEp.addAttachment(org.apache.cxf.endpoint.Endpoint.class, ep);
}
}
}
}
}
if (beanInstance instanceof HTTPTransportFactory) {
HTTPTransportFactory factory = (HTTPTransportFactory) beanInstance;
DestinationRegistry oldRegistry = factory.getRegistry();
if (!(oldRegistry instanceof JBossWSDestinationRegistryImpl)) {
factory.setRegistry(new JBossWSDestinationRegistryImpl());
}
}
super.customize(beanInstance);
}
Aggregations