Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2564 - in development/main/transit/core/handler/src/main/net/dpml/transit: . repository

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2564 - in development/main/transit/core/handler/src/main/net/dpml/transit: . repository
  • Date: Sun, 15 May 2005 21:18:34 +0000

Author: mcconnell AT dpml.net
Date: Sun May 15 21:18:32 2005
New Revision: 2564

Modified:

development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java

development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java

development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java

development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
Log:
Improve Transit expose of the repository service via the Transit instance.
This change allows replacement of new StandardLoader with
Transit.getInstance().getRepository().

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
Sun May 15 21:18:32 2005
@@ -30,6 +30,7 @@
import net.dpml.transit.network.RequestIdentifier;
import net.dpml.transit.network.TransitAuthenticator;
import net.dpml.transit.network.TransitAuthenticatorImpl;
+import net.dpml.transit.repository.Repository;
import net.dpml.transit.repository.StandardLoader;
import net.dpml.transit.util.Util;

@@ -180,6 +181,11 @@
*/
private boolean m_prefsEnabled = false;

+ /**
+ * The repository service provider.
+ */
+ private Repository m_repository;
+
//------------------------------------------------------------------
// constructors
//------------------------------------------------------------------
@@ -315,10 +321,20 @@
}
}

- /**
- * Return cache handler directory.
- * @return the cache handler
- */
+ /**
+ * Return the Transit repository service.
+ * @return the repository service
+ * @exception IllegalStateException if Transit has not been initialized
+ */
+ public Repository getRepository()
+ {
+ return m_repository;
+ }
+
+ /**
+ * Return cache handler directory.
+ * @return the cache handler
+ */
public CacheHandler getCacheHandler()
{
return m_cacheHandler;
@@ -358,6 +374,7 @@
*/
protected void initialize() throws TransitException
{
+ m_repository = new StandardLoader();
if( false == m_prefsEnabled )
{
return;
@@ -370,10 +387,10 @@
try
{
URI uri = new URI( path );
- StandardLoader loader = new StandardLoader();
Object[] args = new Object[]{ prefs, m_logger };
ClassLoader classloader = Transit.class.getClassLoader();
- ContentHandlerRegistry registry = (ContentHandlerRegistry)
loader.getPlugin( classloader, uri, args );
+ ContentHandlerRegistry registry =
+ (ContentHandlerRegistry) getRepository().getPlugin(
classloader, uri, args );
m_contentHandlerRegistry = registry;
m_logger.info( "registry uri: " + path );
}

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/Transit.java
Sun May 15 21:18:32 2005
@@ -157,11 +157,6 @@
//------------------------------------------------------------------

/**
- * Repository established by transit.
- */
- private Repository m_repository;
-
- /**
* Singleton repository monitor router.
*/
private RepositoryMonitorRouter m_repositoryMonitor;
@@ -184,7 +179,6 @@

private SecuredTransitContext m_context;

-
SecuredTransitContext getTransitContext()
{
return m_context;
@@ -258,6 +252,16 @@
}

/**
+ * Return the Transit repository service.
+ * @return the repository service
+ * @exception IllegalStateException if Transit has not been initialized
+ */
+ public Repository getRepository()
+ {
+ return getTransitContext().getRepository();
+ }
+
+ /**
* Start a plugin defined by the supplied uri using the
* command-line argumements and monitors as optional plugin constructor
* arguments. If the supplied plugin class implements the runnable
interface,
@@ -281,7 +285,6 @@
throw new NullArgumentException( "uri" );
}

- m_repository = new StandardLoader();
m_repositoryMonitor.sequenceInfo( "Loading : " + uri );

//
@@ -289,7 +292,7 @@
//

ClassLoader classloader = Main.class.getClassLoader();
- Object object = m_repository.getPlugin( classloader, uri, args );
+ Object object = getRepository().getPlugin( classloader, uri, args );
if( object instanceof Runnable )
{
Thread thread = new Thread( (Runnable) object );

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/repository/Repository.java
Sun May 15 21:18:32 2005
@@ -31,12 +31,6 @@
public interface Repository
{
/**
- * Return the singleton repository instance.
- * @return the repository
- */
- Repository getRepository();
-
- /**
* Creates a plugin descriptor from an artifact.
*
* @param uri the artifact reference to the plugin descriptor

Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/repository/StandardLoader.java
Sun May 15 21:18:32 2005
@@ -77,15 +77,6 @@
//
------------------------------------------------------------------------

/**
- * Return the repository instance.
- * @return the repository
- */
- public Repository getRepository()
- {
- return this; // TODO wrap me in a proxy
- }
-
- /**
* Return the repository monitor router.
* @return the router
*/



  • svn commit: r2564 - in development/main/transit/core/handler/src/main/net/dpml/transit: . repository, mcconnell, 05/15/2005

Archive powered by MHonArc 2.6.24.

Top of Page