use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData in project wildfly by wildfly.
the class WSHandlerChainAnnotationProcessor method getHandlers.
private static Set<String> getHandlers(final InputStream is) throws IOException {
final Set<String> retVal = new HashSet<String>();
final UnifiedHandlerChainsMetaData handlerChainsUMDM = UnifiedHandlerChainsMetaDataParser.parse(is);
if (handlerChainsUMDM != null) {
for (final UnifiedHandlerChainMetaData handlerChainUMDM : handlerChainsUMDM.getHandlerChains()) {
for (final UnifiedHandlerMetaData handlerUMDM : handlerChainUMDM.getHandlers()) {
retVal.add(handlerUMDM.getHandlerClass());
}
}
}
return retVal;
}
use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData in project wildfly by wildfly.
the class WSRefUtils method translate.
static UnifiedServiceRefMetaData translate(final ServiceReferenceMetaData serviceRefMD) {
UnifiedServiceRefMetaDataBuilder builder = new UnifiedServiceRefMetaDataBuilder();
builder.setServiceRefName(serviceRefMD.getName());
builder.setServiceRefType(serviceRefMD.getServiceRefType());
builder.setServiceInterface(serviceRefMD.getServiceInterface());
builder.setWsdlFile(serviceRefMD.getWsdlFile());
builder.setMappingFile(serviceRefMD.getJaxrpcMappingFile());
builder.setServiceQName(serviceRefMD.getServiceQname());
// propagate port components
final Collection<? extends PortComponentRef> portComponentsMD = serviceRefMD.getPortComponentRef();
if (portComponentsMD != null) {
for (final PortComponentRef portComponentMD : portComponentsMD) {
final UnifiedPortComponentRefMetaData portComponentUMDM = getUnifiedPortComponentRefMetaData(portComponentMD);
if (portComponentUMDM.getServiceEndpointInterface() != null || portComponentUMDM.getPortQName() != null) {
builder.addPortComponentRef(portComponentUMDM);
} else {
WSLogger.ROOT_LOGGER.ignoringPortComponentRef(portComponentUMDM);
}
}
}
// propagate handlers
final Collection<ServiceReferenceHandlerMetaData> handlersMD = serviceRefMD.getHandlers();
if (handlersMD != null) {
for (final ServiceReferenceHandlerMetaData handlerMD : handlersMD) {
final UnifiedHandlerMetaData handlerUMDM = getUnifiedHandlerMetaData(handlerMD);
builder.addHandler(handlerUMDM);
}
}
// propagate handler chains
ServiceReferenceHandlerChainsMetaData handlerChainsMD = serviceRefMD.getHandlerChains();
if (handlerChainsMD != null) {
final UnifiedHandlerChainsMetaData handlerChainsUMDM = getUnifiedHandlerChainsMetaData(handlerChainsMD);
builder.setHandlerChains(handlerChainsUMDM);
}
// propagate jboss specific MD
if (serviceRefMD instanceof JBossServiceReferenceMetaData) {
final JBossServiceReferenceMetaData jbossServiceRefMD = (JBossServiceReferenceMetaData) serviceRefMD;
builder.setServiceImplClass(jbossServiceRefMD.getServiceClass());
builder.setConfigName(jbossServiceRefMD.getConfigName());
builder.setConfigFile(jbossServiceRefMD.getConfigFile());
builder.setWsdlOverride(jbossServiceRefMD.getWsdlOverride());
builder.setHandlerChain(jbossServiceRefMD.getHandlerChain());
}
return builder.build();
}
use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData in project wildfly by wildfly.
the class HandlerChainService method start.
@Override
public void start(final StartContext context) throws StartException {
Comparator<UnifiedHandlerMetaData> c = new Comparator<UnifiedHandlerMetaData>() {
@Override
public int compare(UnifiedHandlerMetaData o1, UnifiedHandlerMetaData o2) {
return o1.getId().compareTo(o2.getId());
}
};
synchronized (handlers) {
Collections.sort(handlers, c);
}
handlerChain = new UnifiedHandlerChainMetaData(null, null, protocolBindings, handlers, false, handlerChainId);
}
use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData in project wildfly by wildfly.
the class XTSHandlersManager method getHandlerChain.
public UnifiedHandlerChainMetaData getHandlerChain() {
List<UnifiedHandlerMetaData> handlers = new ArrayList<UnifiedHandlerMetaData>(2);
if (enabled) {
handlers.add(new UnifiedHandlerMetaData(BRIDGE_ENABLED_HANDLER_CLASS, BRIDGE_HANDLER_NAME, null, null, null, null));
handlers.add(new UnifiedHandlerMetaData(WSAT_ENABLED_HANDLER_CLASS, WSAT_HANDLER_NAME, null, null, null, null));
} else {
handlers.add(new UnifiedHandlerMetaData(BRIDGE_DISABLED_HANDLER_CLASS, BRIDGE_HANDLER_NAME, null, null, null, null));
handlers.add(new UnifiedHandlerMetaData(WSAT_DISABLED_HANDLER_CLASS, WSAT_HANDLER_NAME, null, null, null, null));
}
return new UnifiedHandlerChainMetaData(null, null, HANDLER_PROTOCOL_BINDINGS, handlers, false, HANDLER_CHAIN_ID);
}
use of org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData in project wildfly by wildfly.
the class WSRefUtils method getUnifiedHandlerMetaData.
private static UnifiedHandlerMetaData getUnifiedHandlerMetaData(ServiceReferenceHandlerMetaData srhmd) {
List<UnifiedInitParamMetaData> unifiedInitParamMDs = new LinkedList<UnifiedInitParamMetaData>();
List<ParamValueMetaData> initParams = srhmd.getInitParam();
if (initParams != null) {
for (ParamValueMetaData initParam : initParams) {
unifiedInitParamMDs.add(new UnifiedInitParamMetaData(initParam.getParamName(), initParam.getParamValue()));
}
}
List<QName> soapHeaders = srhmd.getSoapHeader();
Set<QName> soapHeaderList = soapHeaders != null ? new HashSet<QName>(soapHeaders) : null;
List<String> soapRoles = srhmd.getSoapRole();
Set<String> soapRolesList = soapRoles != null ? new HashSet<String>(soapRoles) : null;
List<String> portNames = srhmd.getPortName();
Set<String> portNameList = portNames != null ? new HashSet<String>(portNames) : null;
return new UnifiedHandlerMetaData(srhmd.getHandlerClass(), srhmd.getHandlerName(), unifiedInitParamMDs, soapHeaderList, soapRolesList, portNameList);
}
Aggregations