synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r563540 - /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
Date Tue, 07 Aug 2007 16:08:06 GMT
Author: pzf
Date: Tue Aug  7 09:08:05 2007
New Revision: 563540

URL: http://svn.apache.org/viewvc?view=rev&rev=563540
Log:
added SimpleQuartz startup, factory, synapse Job Interface and a simple MessageInjector job

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java?view=diff&rev=563540&r1=563539&r2=563540
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/StartupFinder.java
Tue Aug  7 09:08:05 2007
@@ -13,6 +13,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.Startup;
+import org.apache.synapse.startup.quartz.SimpleQuartzFactory;
 
 import sun.misc.Service;
 
@@ -43,15 +44,27 @@
 		instance = null;
 	}
 
+	private static final Class[] builtins = { SimpleQuartzFactory.class};
+	
 	private StartupFinder() {
-		factoryMap = new HashMap();
+		// preregister any built in
+		for (int i=0; i<builtins.length;i++) {
+			Class b = builtins[i];
+			StartupFactory sf;
+			try {
+				sf = (StartupFactory)b.newInstance();
+			} catch (Exception e) {
+				throw new SynapseException("cannot instantiate "+b.getName(),e);
+				
+			}
+			factoryMap.put(sf.getTagQName(), b);
+			serializerMap.put(sf.getTagQName(),sf.getSerializerClass());
+	
+		}
+		
 		registerExtensions();
 	}
 
-	private void handleException(String msg, Exception e) {
-		log.error(msg, e);
-		throw new SynapseException(msg, e);
-	}
 
 	private void handleException(String msg) {
 		log.error(msg);



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message