+ Added class ProxyOptionalFactory which delegates all calls + to configured delegate. Via noInitializationFinish it + is possible to supress finishInitialization() method when + it is not required by the plugin. +
++ Designed to be used from XML Layer. +
+noInitializationFinish
attribute as a way
+ * to prevent delegate's {@link #finishServerInitialization()} to be called.
+ * This can be useful in situation when we want to prevent loading unnecessary
+ * code (from delegate) being loaded during the {@link #finishServerInitialization()}
+ * call. Designed to be used via XML layer filesystem.
+ *
+ * @author Petr Hejl
+ * @since 1.66
+ */
+public final class ProxyOptionalFactory extends OptionalDeploymentManagerFactory {
+
+ private final Map attributes;
+
+ private final boolean noInitializationFinish;
+
+ /* GuardedBy("this") */
+ private OptionalDeploymentManagerFactory delegate;
+
+ private ProxyOptionalFactory(Map attributes) {
+ this.attributes = attributes;
+
+ Boolean finish = (Boolean) attributes.get("noInitializationFinish"); // NOI18N
+ this.noInitializationFinish = finish == null ? false : finish.booleanValue();
+ }
+
+ public static ProxyOptionalFactory create(Map map) {
+ return new ProxyOptionalFactory(map);
+ }
+
+ @Override
+ public boolean isCommonUIRequired() {
+ return getDelegate().isCommonUIRequired();
+ }
+
+ @Override
+ public TargetModuleIDResolver getTargetModuleIDResolver(DeploymentManager dm) {
+ return getDelegate().getTargetModuleIDResolver(dm);
+ }
+
+ @Override
+ public StartServer getStartServer(DeploymentManager dm) {
+ return getDelegate().getStartServer(dm);
+ }
+
+ @Override
+ public ServerInstanceDescriptor getServerInstanceDescriptor(DeploymentManager dm) {
+ return getDelegate().getServerInstanceDescriptor(dm);
+ }
+
+ @Override
+ public MessageDestinationDeployment getMessageDestinationDeployment(DeploymentManager dm) {
+ return getDelegate().getMessageDestinationDeployment(dm);
+ }
+
+ @Override
+ public JDBCDriverDeployer getJDBCDriverDeployer(DeploymentManager dm) {
+ return getDelegate().getJDBCDriverDeployer(dm);
+ }
+
+ @Override
+ public IncrementalDeployment getIncrementalDeployment(DeploymentManager dm) {
+ return getDelegate().getIncrementalDeployment(dm);
+ }
+
+ @Override
+ public FindJSPServlet getFindJSPServlet(DeploymentManager dm) {
+ return getDelegate().getFindJSPServlet(dm);
+ }
+
+ @Override
+ public DatasourceManager getDatasourceManager(DeploymentManager dm) {
+ return getDelegate().getDatasourceManager(dm);
+ }
+
+ @Override
+ public AntDeploymentProvider getAntDeploymentProvider(DeploymentManager dm) {
+ return getDelegate().getAntDeploymentProvider(dm);
+ }
+
+ @Override
+ public InstantiatingIterator getAddInstanceIterator() {
+ return getDelegate().getAddInstanceIterator();
+ }
+
+ @Override
+ public void finishServerInitialization() throws ServerInitializationException {
+ if (!noInitializationFinish) {
+ getDelegate().finishServerInitialization();
+ }
+ }
+
+ private OptionalDeploymentManagerFactory getDelegate() {
+ synchronized (this) {
+ if (delegate != null) {
+ return delegate;
+ }
+ }
+
+ OptionalDeploymentManagerFactory factory = (OptionalDeploymentManagerFactory) attributes.get("delegate"); // NOI18N
+ Parameters.notNull("delegate", factory); // NOI18N
+
+ synchronized (this) {
+ if (delegate == null) {
+ delegate = factory;
+ }
+ return delegate;
+ }
+ }
+
+}
diff -Naur factory/j2ee.weblogic9/nbproject/project.xml optional/j2ee.weblogic9/nbproject/project.xml
--- factory/j2ee.weblogic9/nbproject/project.xml 2010-02-17 20:49:36.000000000 +0100
+++ optional/j2ee.weblogic9/nbproject/project.xml 2010-02-18 10:51:41.000000000 +0100
@@ -110,7 +110,7 @@