logo       

jicarilla-sandbox/platform/container/impl/src/java/com/leosimons/jicarilla/: msg#00038

Subject: jicarilla-sandbox/platform/container/impl/src/java/com/leosimons/jicarilla/container ClassUtil.java,1.4,1.5
Update of 
/cvsroot/jicarilla/jicarilla-sandbox/platform/container/impl/src/java/com/leosimons/jicarilla/container
In directory 
sc8-pr-cvs1:/tmp/cvs-serv27012/platform/container/impl/src/java/com/leosimons/jicarilla/container

Modified Files:
        ClassUtil.java 
Log Message:
reference new avalon package

Index: ClassUtil.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/container/impl/src/java/com/leosimons/jicarilla/container/ClassUtil.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ClassUtil.java      30 Dec 2003 20:44:01 -0000      1.4
+++ ClassUtil.java      30 Dec 2003 21:23:15 -0000      1.5
@@ -26,6 +26,8 @@
 package com.leosimons.jicarilla.container;
 
 import com.leosimons.jicarilla.framework.Assert;
+import 
com.leosimons.jicarilla.container.integration.avalon.JicarillaBasedAvalonContext;
+import 
com.leosimons.jicarilla.container.integration.avalon.JicarillaBasedAvalonServiceManager;
 import com.thoughtworks.xstream.XStream;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -33,11 +35,9 @@
 import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.logger.ConsoleLogger;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.xml.sax.SAXException;
 
@@ -56,6 +56,8 @@
 import java.util.Set;
 
 /**
+ * This is the big fat ugly class full of introspection magic.
+ *
  * @author <a href="mail at leosimons dot com">Leo Simons</a>
  * @version $Id$
  */
@@ -309,12 +311,12 @@
 
     protected static Context getContext( Container container )
     {
-        return new ClassUtil.JicarillaContainerContext( container );
+        return new JicarillaBasedAvalonContext( container );
     }
 
     protected static ServiceManager getServiceManager( Container container )
     {
-        return new JicarillaContainerServiceManager( container );
+        return new JicarillaBasedAvalonServiceManager( container );
     }
 
     protected static Configuration getConfiguration( Container container, 
String className )
@@ -396,84 +398,4 @@
         }
         return instance;
     }
-
-    protected static class JicarillaContainerContext implements Context
-    {
-        protected Container m_container;
-
-        public JicarillaContainerContext( Container container )
-        {
-            m_container = container;
-        }
-
-        public Object get( Object key ) throws ContextException
-        {
-            if( key == null )
-                throw new ContextException( "No value exists for key 'null'" );
-
-            Object result = null;
-            try
-            {
-                result = m_container.get( key );
-            }
-            catch( Exception e )
-            {
-                throw new ContextException(
-                        "Unable to get " + key.toString() + "from the 
context", e );
-            }
-
-            if( result == null )
-                throw new ContextException( "No value exists for key " + 
key.toString() );
-
-            return result;
-        }
-    }
-
-    /** @todo figure out how to detect cyclic dependencies here */
-    protected static class JicarillaContainerServiceManager implements 
ServiceManager
-    {
-        protected Container m_container;
-
-        public JicarillaContainerServiceManager( Container container )
-        {
-            m_container = container;
-        }
-
-        public Object lookup( String key ) throws ServiceException
-        {
-            if( key == null )
-                throw new ServiceException( key, "No value exists for key 
'null'" );
-
-            Object result = null;
-            try
-            {
-                result = m_container.get( key );
-            }
-            catch( Exception e )
-            {
-                throw new ServiceException( key,
-                        "Unable to get " + key + "from the ServiceManager", e 
);
-            }
-
-            if( result == null )
-                throw new ServiceException( key, "No value exists for key " + 
key.toString() );
-
-            return result;
-        }
-
-        public boolean hasService( String key )
-        {
-            return m_container.contains( key );
-        }
-
-        public void release( Object component )
-        {
-            try
-            {
-                m_container.release( component );
-            }
-            catch( Exception e ) {}
-        }
-    }
-
 }




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe