private static List listChannelClasses(ServicesConfiguration config) { List channelList = new ArrayList(); Iterator it = config.getAllChannelSettings().values().iterator(); while (it.hasNext()) { ChannelSettings settings = (ChannelSettings)it.next(); String clientType = settings.getClientType(); channelList.add(clientType); } return channelList; }
private void channelServerOnlyAttribute(Node channel, ChannelSettings channelSettings) { String clientType = getAttributeOrChildElement(channel, CLASS_ATTR); clientType = clientType.length() > 0 ? clientType : null; String serverOnlyString = getAttributeOrChildElement(channel, SERVER_ONLY_ATTR); boolean serverOnly = serverOnlyString.length() > 0 ? Boolean.valueOf(serverOnlyString) : false; if (clientType == null && !serverOnly) // None set. { String url = channelSettings.getUri(); boolean serverOnlyProtocol = (url.startsWith("samfsocket") || url.startsWith("amfsocket") || url.startsWith("ws")); if (!serverOnlyProtocol) { // Endpoint ''{0}'' needs to have either class or server-only attribute defined. ConfigurationException ce = new ConfigurationException(); ce.setMessage(CLASS_OR_SERVER_ONLY_ERROR, new Object[]{channelSettings.getId()}); throw ce; } channelSettings.setServerOnly(true); } else if (clientType != null && serverOnly) // Both set. { // Endpoint ''{0}'' cannot have both class and server-only attribute defined. ConfigurationException ce = new ConfigurationException(); ce.setMessage(CLASS_AND_SERVER_ONLY_ERROR, new Object[]{channelSettings.getId()}); throw ce; } else // One of them set. { if (serverOnly) channelSettings.setServerOnly(true); else channelSettings.setClientType(clientType); } }
public void setUri(String uri) { this.uri = uri; port = parsePort(this, uri); contextParsed = false; clientContextParsed = false; }
String url = chanSettings.getUri(); String endpointClassName = chanSettings.getEndpointType(); if (chanSettings.isRemote()) continue; endpoint.setSecurityConstraint(chanSettings.getConstraint()); endpoint.setClientType(chanSettings.getClientType()); String referencedServerId = chanSettings.getServerId(); if ((referencedServerId != null) && (endpoint instanceof Endpoint2)) ce.setMessage(11128, new Object[] {chanSettings.getId(), referencedServerId}); throw ce; endpoint.initialize(id, chanSettings.getProperties());
ChannelSettings channelSettings = new ChannelSettings(id); channelSettings.setSourceFile(getSourceFileOf(channel)); channelSettings.setClientType(clientType); channelSettings.setRemote(Boolean.valueOf(remote).booleanValue()); channelSettings.setEndpointType(type); if (uri == null || EMPTY_STRING.equals(uri)) uri = getAttributeOrChildElement(endpoint, URI_ATTR); channelSettings.setUri(uri); channelSettings.setServerId(serverId); channelSettings.addProperties(map); if (sc != null) channelSettings.setConstraint(sc); channelSettings.setConstraint(sc);
for (Iterator chanIter = dest.getChannelSettings().iterator(); chanIter.hasNext();) e4x.append("\t\t\t\t<channel ref=\"" + ((ChannelSettings) chanIter.next()).getId() + "\"/>\n"); channelType = chan.getClientType(); serviceImportMap.put(channelType, channelType); e4x.append("\t\t<channel id=\"" + chan.getId() + "\" type=\"" + channelType + "\">\n"); e4x.append("\t\t\t<endpoint uri=\"" + chan.getClientParsedUri(contextRoot) + "\"/>\n"); e4x.append("\t\t\t<properties>\n"); channelProperties(chan.getProperties(), e4x, "\t\t\t\t"); e4x.append("\t\t\t</properties>\n"); e4x.append("\t\t</channel>\n");
ChannelSettings channelSettings = new ChannelSettings(id); channelSettings.setClientType(clientType); if (uri == null || EMPTY_STRING.equals(uri)) uri = getAttributeOrChildElement(endpoint, URI_ATTR); channelSettings.setUri(uri); channelSettings.addProperties(map); channelSettings.addProperties(map); channelSettings.addProperties(map); channelSettings.addProperties(map); channelSettings.addProperty(SERIALIZATION_ELEMENT, clientMap); channelSettings.addProperties(map); channelSettings.addProperties(map); channelSettings.addProperties(map); channelSettings.addProperties(map);
ChannelSettings channelSettings = new ChannelSettings(id); if (uri == null || EMPTY_STRING.equals(uri)) uri = getAttributeOrChildElement(endpoint, URI_ATTR); channelSettings.setUri(uri); channelSettings.addProperty(SERIALIZATION_ELEMENT, clientMap);
service.addDefaultChannel(chanSettings.getId());
if (channelSettings.isRemote()) continue; gatherUnusedProperties(channelSettings.getId(), channelSettings.getSourceFile(), ConfigurationConstants.CHANNEL_ELEMENT, channelSettings, findings);
private void addProperty(Node channel, ChannelSettings channelSettings, String property) { NodeList properties = selectNodeList(channel, PROPERTIES_ELEMENT + "/" + property); if (properties.getLength() > 0) { ConfigMap map = properties(properties, getSourceFileOf(channel)); if (CLIENT_LOAD_BALANCING_ELEMENT.equals(property)) { ConfigMap clientLoadBalancingMap = map.getPropertyAsMap(CLIENT_LOAD_BALANCING_ELEMENT, null); if (clientLoadBalancingMap == null) { // Invalid {0} configuration for endpoint ''{1}''; no urls defined. ConfigurationException ce = new ConfigurationException(); ce.setMessage(ERR_MSG_EMPTY_CLIENT_LOAD_BALANCING_ELEMENT, new Object[]{CLIENT_LOAD_BALANCING_ELEMENT, channelSettings.getId()}); throw ce; } List urls = clientLoadBalancingMap.getPropertyAsList(URL_ATTR, null); addClientLoadBalancingUrls(urls, channelSettings.getId()); } channelSettings.addProperties(map); } }
String url = chanSettings.getUri(); String endpointClassName = chanSettings.getEndpointType(); abstractEndpoint.setRemote(chanSettings.isRemote()); abstractEndpoint.setServerOnly(chanSettings.getServerOnly()); endpoint.setSecurityConstraint(chanSettings.getConstraint()); endpoint.setClientType(chanSettings.getClientType()); String referencedServerId = chanSettings.getServerId(); if ((referencedServerId != null) && (endpoint instanceof Endpoint2)) ce.setMessage(11128, new Object[] {chanSettings.getId(), referencedServerId}); throw ce; endpoint.initialize(id, chanSettings.getProperties());
ChannelSettings channelSettings = new ChannelSettings(id); channelSettings.setSourceFile(getSourceFileOf(channel)); channelSettings.setRemote(Boolean.valueOf(remote)); channelSettings.setEndpointType(type); if (uri == null || EMPTY_STRING.equals(uri)) uri = getAttributeOrChildElement(endpoint, URI_ATTR); channelSettings.setUri(uri); channelSettings.setServerId(serverId); if (properties.getLength() > 0) { ConfigMap map = properties(properties, getSourceFileOf(channel)); channelSettings.addProperties(map); SecurityConstraint sc = ((MessagingConfiguration) config).getSecuritySettings().getConstraint(ref); if (sc != null) { channelSettings.setConstraint(sc); } else { if (constraint != null) { SecurityConstraint sc = securityConstraint(constraint, true); channelSettings.setConstraint(sc);
for (Iterator chanIter = dest.getChannelSettings().iterator(); chanIter.hasNext();) e4x.append("\t\t\t\t<channel ref=\"" + ((ChannelSettings) chanIter.next()).getId() + "\"/>\n"); if (chan.getServerOnly()) // Skip server-only channels. continue; channelType = chan.getClientType(); serviceImportMap.put(channelType, channelType); e4x.append("\t\t<channel id=\"" + chan.getId() + "\" type=\"" + channelType + "\">\n"); StringBuffer channelProps = new StringBuffer(); containsClientLoadBalancing = false; channelProperties(chan.getProperties(), channelProps, "\t\t\t\t"); if (!containsClientLoadBalancing) // Add the uri, only when there is no client-load-balancing defined. e4x.append("\t\t\t<endpoint uri=\"" + chan.getClientParsedUri(contextRoot) + "\"/>\n"); containsClientLoadBalancing = false; e4x.append("\t\t\t<properties>\n");
ChannelSettings channelSettings = new ChannelSettings(id); if (uri == null || EMPTY_STRING.equals(uri)) uri = getAttributeOrChildElement(endpoint, URI_ATTR); channelSettings.setUri(uri); channelSettings.addProperty(SERIALIZATION_ELEMENT, clientMap);
service.addDefaultChannel(chanSettings.getId());
if (channelSettings.isRemote()) continue; gatherUnusedProperties(channelSettings.getId(), channelSettings.getSourceFile(), ConfigurationConstants.CHANNEL_ELEMENT, channelSettings, findings);
private void addProperty(Node channel, ChannelSettings channelSettings, String property) { NodeList properties = selectNodeList(channel, PROPERTIES_ELEMENT + "/" + property); if (properties.getLength() > 0) { ConfigMap map = properties(properties, getSourceFileOf(channel)); if (CLIENT_LOAD_BALANCING_ELEMENT.equals(property)) { ConfigMap clientLoadBalancingMap = map.getPropertyAsMap(CLIENT_LOAD_BALANCING_ELEMENT, null); if (clientLoadBalancingMap == null) { // Invalid {0} configuration for endpoint ''{1}''; no urls defined. ConfigurationException ce = new ConfigurationException(); ce.setMessage(ERR_MSG_EMPTY_CLIENT_LOAD_BALANCING_ELEMENT, new Object[]{CLIENT_LOAD_BALANCING_ELEMENT, channelSettings.getId()}); throw ce; } List urls = clientLoadBalancingMap.getPropertyAsList(URL_ATTR, null); addClientLoadBalancingUrls(urls, channelSettings.getId()); } channelSettings.addProperties(map); } }