jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla PureJavaMain.java,1.4,1.5

Leo Simons <[email protected]>
Newsgroups gmane.comp.java.jicarilla.cvs
Message-ID <[email protected]>
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25460/platform/components/http/impl/src/java/org/jicarilla

Modified Files:
	PureJavaMain.java 
Log Message:
its now possible to do stuff like...
        builder.addComponent(
                SocketServer.class,
                new CustomComponent( SocketServerImpl.class )
                    .redirectCall( 3, "event-pool" )
                    .redirectCall( 4, "pipeline-pool" )
                    .redirectCall( 5, "error-handler" )
        );
        
...so let's do it.

Index: PureJavaMain.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/components/http/impl/src/java/org/jicarilla/PureJavaMain.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- PureJavaMain.java	23 Mar 2004 13:37:49 -0000	1.4
+++ PureJavaMain.java	23 Mar 2004 16:03:07 -0000	1.5
@@ -36,8 +36,12 @@
 import org.apache.commons.logging.impl.SimpleLog;
 import org.apache.commons.pool.impl.SoftReferenceObjectPool;
 import org.jicarilla.container.Resolver;
+import org.jicarilla.container.DefaultCustomizableResolver;
+import org.jicarilla.container.adapters.SingletonAdapter;
+import org.jicarilla.container.factories.Type3Factory;
 import org.jicarilla.container.builder.Builder;
 import org.jicarilla.container.builder.DefaultBuilder;
+import org.jicarilla.container.builder.CustomComponent;
 import org.jicarilla.container.selectors.ClassSelector;
 import org.jicarilla.lang.Active;
 import org.jicarilla.lang.ExceptionListener;
@@ -264,12 +268,13 @@
         final Builder builder = DefaultBuilder.newInstance()
             .addComponent( m_log )
             .addComponent( m_config );
+        m_resolver = builder.getResolver();
 
         // todo move jetty support elsewhere
         //populate( builder );
         populateWithJetty( builder );
 
-        m_resolver = builder.create();
+        builder.create();
     }
 
     protected void setupConfig() throws ClassNotFoundException
@@ -389,8 +394,31 @@
                 "error-handler",
                 new NoopSink()
         );
+        
+        /*DefaultCustomizableResolver customResolver =
+                new DefaultCustomizableResolver( m_resolver )
+                .redirectCall( 3, "event-pool" )
+                .redirectCall( 4, "pipeline-pool" )
+                .redirectCall( 5, "error-handler" );
+        Type3Factory factory = new Type3Factory( customResolver,
+                SocketServerImpl.class.getName() );
+        SingletonAdapter adapter = new SingletonAdapter( factory );
+        
+        builder.addComponent(
+                SocketServer.class,
+                adapter
+        );*/
+        
         builder.addComponent(
                 SocketServer.class,
+                new CustomComponent( SocketServerImpl.class )
+                    .redirectCall( 3, "event-pool" )
+                    .redirectCall( 4, "pipeline-pool" )
+                    .redirectCall( 5, "error-handler" )
+        );
+        
+        /*builder.addComponent(
+                SocketServer.class,
                 new CachingComponentAdapter(
                         new ConstructorComponentAdapter(
                                 SocketServer.class,
@@ -405,7 +433,7 @@
                                 }
                         )
                 )
-        );
+        );*/
     }
 
     // ----------------------------------------------------------------------



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.