jicarilla-sandbox/platform/container-integration/src/java/org/jicarilla/container/integration/builder ResourceLocatorHelper.java,NONE,1.1 JicarillaBuilder.java,1.3,1.4
Leo Simons <[email protected]>
| Newsgroups | gmane.comp.java.jicarilla.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/container-integration/src/java/org/jicarilla/container/integration/builder
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28741/platform/container-integration/src/java/org/jicarilla/container/integration/builder
Modified Files:
JicarillaBuilder.java
Added Files:
ResourceLocatorHelper.java
Log Message:
support dna in the Builder
Index: JicarillaBuilder.java
===================================================================
RCS file: /cvsroot/jicarilla/jicarilla-sandbox/platform/container-integration/src/java/org/jicarilla/container/integration/builder/JicarillaBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- JicarillaBuilder.java 23 Mar 2004 13:37:55 -0000 1.3
+++ JicarillaBuilder.java 3 Apr 2004 12:59:10 -0000 1.4
@@ -25,27 +25,28 @@
==================================================================== */
package org.jicarilla.container.integration.builder;
-import org.jicarilla.container.Container;
+import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.jcontainer.dna.ResourceLocator;
import org.jicarilla.container.Adapter;
+import org.jicarilla.container.Container;
+import org.jicarilla.container.DefaultKeyRelayingContainer;
import org.jicarilla.container.KeyAwareAdapter;
+import org.jicarilla.container.KeyRelayingContainer;
import org.jicarilla.container.Resolver;
import org.jicarilla.container.ResolverProvider;
-import org.jicarilla.container.KeyRelayingContainer;
-import org.jicarilla.container.DefaultKeyRelayingContainer;
-import org.jicarilla.container.builder.DefaultBuilder;
-import org.jicarilla.container.builder.Builder;
-import org.jicarilla.container.builder.ResolverProviderHelper;
-import org.jicarilla.container.builder.ResolverHelper;
-import org.jicarilla.container.builder.KeyAwareAdapterHelper;
import org.jicarilla.container.builder.AdapterHelper;
+import org.jicarilla.container.builder.Builder;
+import org.jicarilla.container.builder.DefaultBuilder;
+import org.jicarilla.container.builder.DefaultHelper;
import org.jicarilla.container.builder.EntryHelper;
+import org.jicarilla.container.builder.KeyAwareAdapterHelper;
+import org.jicarilla.container.builder.ResolverHelper;
+import org.jicarilla.container.builder.ResolverProviderHelper;
import org.jicarilla.container.builder.SingletonType35Helper;
-import org.jicarilla.container.builder.DefaultHelper;
import org.jicarilla.lang.Assert;
import org.picocontainer.PicoContainer;
import org.springframework.beans.factory.BeanFactory;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.component.ComponentManager;
/**
* <p>A Builder implementation that's backed by a container itself. In essence,
@@ -56,6 +57,7 @@
* <pre>
* PicoContainer picoContainer = getPicoContainer();
* Container fortressContainer = getFortressContainer();
+ * ResourceLocator dnaContainer = getDnaContainer();
* Resolver parentContainerResolver = getParentResolver();
* Resolver resolver =
* JicarillaBuilder.newInstance()
@@ -72,10 +74,26 @@
* )
* )
* )
- * .addComponent( LisaImpl.class )
+ * .addComponent(
+ * new ClassSelector( Lisa.class ),
+ * new SingletonAdapter(
+ * new DnaFactory(
+ * new DnaLisa()
+ * )
+ * )
+ * )
+ * .addComponent(
+ * new ClassSelector( Maggie.class ),
+ * new SingletonAdapter(
+ * new Type1Factory(
+ * new AvalonMaggie()
+ * )
+ * )
+ * )
* .addComponent( parentContainerResolver )
* .addComponent( picoContainer )
* .addComponent( fortressContainer )
+ * .addComponent( dnaContainer )
* .create();
* </pre>
*
@@ -208,7 +226,10 @@
// --------------------------------------------------------------------
// DNA support
// --------------------------------------------------------------------
- // todo
+ addHelper(
+ ResourceLocator.class,
+ ResourceLocatorHelper.class
+ );
// --------------------------------------------------------------------
// Loom support
--- NEW FILE: ResourceLocatorHelper.java ---
/* ====================================================================
The Jicarilla Software License
Copyright (c) 2003 Leo Simons.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.integration.builder;
import org.jcontainer.dna.ResourceLocator;
import org.jicarilla.container.KeyAwareAdapter;
import org.jicarilla.container.builder.BuilderHelper;
import org.jicarilla.container.integration.dna.ResourceLocatorBasedKeyAwareComponentAdapter;
import org.jicarilla.container.integration.dna.ResourceLocatorBasedSelector;
import org.jicarilla.lang.Selector;
/**
*
*
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: ResourceLocatorHelper.java,v 1.1 2004/04/03 12:59:17 lsimons Exp $
*/
public class ResourceLocatorHelper implements BuilderHelper
{
public KeyAwareAdapter getAdapter( final Object provider )
throws Exception
{
return new ResourceLocatorBasedKeyAwareComponentAdapter(
(ResourceLocator)provider
);
}
public Selector getSelector( final Object provider ) throws Exception
{
return new ResourceLocatorBasedSelector(
(ResourceLocator)provider
);
}
}
-------------------------------------------------------
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