}
ObjectRecipe recipe = new ObjectRecipe(className, properties);
recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
recipe.setConstructorArgTypes(new Class[] { String.class });
recipe.setConstructorArgNames(new String[] { "protocol" });
Connector connector = (Connector) recipe.create(cl);
boolean executorSupported = !connector.getProtocolHandlerClassName().equals("org.apache.jk.server.JkCoyoteHandler");
for (Map.Entry<QName, String> entry : otherAttributes.entrySet()) {
String name = entry.getKey().getLocalPart();
String value = entry.getValue();
if (executorSupported && "executor".equals(name)) {
Executor executor = service.getExecutor(entry.getValue());
if (executor == null) {
throw new IllegalArgumentException("No executor found in service with name: " + value);
}
IntrospectionUtils.callMethod1(connector.getProtocolHandler(),
"setExecutor",
executor,
java.util.concurrent.Executor.class.getName(),
cl);
} else if ("name".equals(name)) {
//name attribute is held by Geronimo to identify the connector, it is not required by Tomcat
TomcatServerGBean.ConnectorName.put(connector, value);
} else {
if ("keystorePass".equals(name)) {
value = (String) EncryptionManager.decrypt(value);
}
connector.setProperty(name, value);
}
}
for (ListenerType listenerType : getListener()) {
LifecycleListener listener = listenerType.getLifecycleListener(cl);
connector.addLifecycleListener(listener);
TomcatServerGBean.LifecycleListeners.add(listener);
}
return connector;
}