You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2006/07/28 07:49:50 UTC
svn commit: r426392 [33/47] - in /incubator/servicemix/trunk:
apache-servicemix/src/main/assembly/ apache-servicemix/src/main/release/conf/
apache-servicemix/src/main/release/examples/basic/
apache-servicemix/src/main/release/examples/bpel-bpe/ apache-...
Modified: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/CommonsLoggingMonitorFactory.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/CommonsLoggingMonitorFactory.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/CommonsLoggingMonitorFactory.java (original)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/CommonsLoggingMonitorFactory.java Thu Jul 27 22:49:32 2006
@@ -1,87 +1,87 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.sca.tuscany;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tuscany.common.monitor.MonitorFactory;
-
-public class CommonsLoggingMonitorFactory implements MonitorFactory {
-
- private final Map<Class<?>, WeakReference<?>> proxies = new WeakHashMap<Class<?>, WeakReference<?>>();
-
- public CommonsLoggingMonitorFactory() {
- }
-
- public <T> T getMonitor(Class<T> monitorInterface) {
- T proxy = getCachedMonitor(monitorInterface);
- if (proxy == null) {
- proxy = createMonitor(monitorInterface);
- proxies.put(monitorInterface, new WeakReference<T>(proxy));
- }
- return proxy;
- }
-
- private <T>T getCachedMonitor(Class<T> monitorInterface) {
- WeakReference<T> ref = (WeakReference<T>) proxies.get(monitorInterface);
- return (ref != null) ? ref.get() : null;
- }
-
- private <T>T createMonitor(Class<T> monitorInterface) {
- String className = monitorInterface.getName();
- Log logger = LogFactory.getLog(className);
- InvocationHandler handler = new LoggingHandler(logger);
- return (T) Proxy.newProxyInstance(monitorInterface.getClassLoader(), new Class<?>[]{monitorInterface}, handler);
- }
-
- private static final class LoggingHandler implements InvocationHandler {
- private final Log logger;
-
- public LoggingHandler(Log logger) {
- this.logger = logger;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- String sourceMethod = method.getName();
- if (logger.isDebugEnabled()) {
- // if the only argument is a Throwable use the special logger for it
- if (args != null && args.length == 1 && args[0] instanceof Throwable) {
- logger.debug(sourceMethod, (Throwable) args[0]);
- } else {
- StringBuilder sb = new StringBuilder();
- sb.append(sourceMethod);
- sb.append("(");
- for (int i = 0; i < args.length; i++) {
- if (i > 0) {
- sb.append(", ");
- }
- sb.append(args[i]);
- }
- sb.append(")");
- logger.debug(sb.toString());
- }
- }
- return null;
- }
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.tuscany;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tuscany.common.monitor.MonitorFactory;
+
+public class CommonsLoggingMonitorFactory implements MonitorFactory {
+
+ private final Map<Class<?>, WeakReference<?>> proxies = new WeakHashMap<Class<?>, WeakReference<?>>();
+
+ public CommonsLoggingMonitorFactory() {
+ }
+
+ public <T> T getMonitor(Class<T> monitorInterface) {
+ T proxy = getCachedMonitor(monitorInterface);
+ if (proxy == null) {
+ proxy = createMonitor(monitorInterface);
+ proxies.put(monitorInterface, new WeakReference<T>(proxy));
+ }
+ return proxy;
+ }
+
+ private <T>T getCachedMonitor(Class<T> monitorInterface) {
+ WeakReference<T> ref = (WeakReference<T>) proxies.get(monitorInterface);
+ return (ref != null) ? ref.get() : null;
+ }
+
+ private <T>T createMonitor(Class<T> monitorInterface) {
+ String className = monitorInterface.getName();
+ Log logger = LogFactory.getLog(className);
+ InvocationHandler handler = new LoggingHandler(logger);
+ return (T) Proxy.newProxyInstance(monitorInterface.getClassLoader(), new Class<?>[]{monitorInterface}, handler);
+ }
+
+ private static final class LoggingHandler implements InvocationHandler {
+ private final Log logger;
+
+ public LoggingHandler(Log logger) {
+ this.logger = logger;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ String sourceMethod = method.getName();
+ if (logger.isDebugEnabled()) {
+ // if the only argument is a Throwable use the special logger for it
+ if (args != null && args.length == 1 && args[0] instanceof Throwable) {
+ logger.debug(sourceMethod, (Throwable) args[0]);
+ } else {
+ StringBuilder sb = new StringBuilder();
+ sb.append(sourceMethod);
+ sb.append("(");
+ for (int i = 0; i < args.length; i++) {
+ if (i > 0) {
+ sb.append(", ");
+ }
+ sb.append(args[i]);
+ }
+ sb.append(")");
+ logger.debug(sb.toString());
+ }
+ }
+ return null;
+ }
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/CommonsLoggingMonitorFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java (original)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java Thu Jul 27 22:49:32 2006
@@ -1,171 +1,171 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.sca.tuscany;
-
-import java.util.List;
-
-import org.apache.tuscany.common.monitor.MonitorFactory;
-import org.apache.tuscany.common.monitor.impl.NullMonitorFactory;
-import org.apache.tuscany.core.builder.ContextFactoryBuilder;
-import org.apache.tuscany.core.builder.impl.DefaultWireBuilder;
-import org.apache.tuscany.core.config.ConfigurationException;
-import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader;
-import org.apache.tuscany.core.context.AggregateContext;
-import org.apache.tuscany.core.context.CoreRuntimeException;
-import org.apache.tuscany.core.context.EventContext;
-import org.apache.tuscany.core.context.SystemAggregateContext;
-import org.apache.tuscany.core.runtime.RuntimeContext;
-import org.apache.tuscany.core.runtime.RuntimeContextImpl;
-import org.apache.tuscany.model.assembly.AssemblyModelContext;
-import org.apache.tuscany.model.assembly.ModuleComponent;
-import org.apache.tuscany.model.scdl.loader.SCDLModelLoader;
-import org.osoa.sca.ModuleContext;
-import org.osoa.sca.SCA;
-import org.osoa.sca.ServiceRuntimeException;
-
-public class TuscanyRuntime extends SCA {
- private final TuscanyRuntime.Monitor monitor;
- private final Object sessionKey = new Object();
-
- private final RuntimeContext runtime;
- private final AggregateContext moduleContext;
-
- private final ModuleComponent moduleComponent;
-
- private static final String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system";
-
- /**
- * Construct a runtime using a null MonitorFactory.
- *
- * @param name the name of the module component
- * @param uri the URI to assign to the module component
- * @throws ConfigurationException if there was a problem loading the SCA configuration
- * @see TuscanyRuntime#TuscanyRuntime(String, String, org.apache.tuscany.common.monitor.MonitorFactory)
- */
- public TuscanyRuntime(String name, String uri) throws ConfigurationException {
- this(name, uri,
- Thread.currentThread().getContextClassLoader(),
- new NullMonitorFactory());
- }
-
- /**
- * Construct a runtime containing a single module component with the
- * specified name. The module definition is loaded from a "/sca.module"
- * resource found on the classpath of the current Thread context classloader.
- *
- * @param name the name of the module component
- * @param uri the URI to assign to the module component
- * @param classLoader the class loader to use for the assembly
- * @param monitorFactory the MonitorFactory for this runtime
- * @throws ConfigurationException if there was a problem loading the SCA configuration
- */
- public TuscanyRuntime(String name, String uri, ClassLoader classLoader, MonitorFactory monitorFactory) throws ConfigurationException {
- this.monitor = monitorFactory.getMonitor(TuscanyRuntime.Monitor.class);
-
- // Create an assembly model context
- AssemblyModelContext modelContext = BootstrapHelper.getModelContext(classLoader);
-
- // Create a runtime context and start it
- List<SCDLModelLoader> loaders = modelContext.getAssemblyLoader().getLoaders();
- List<ContextFactoryBuilder> configBuilders = BootstrapHelper.getBuilders();
- runtime = new RuntimeContextImpl(monitorFactory, loaders, configBuilders, new DefaultWireBuilder());
- runtime.start();
- monitor.started(runtime);
-
- // Load and start the system configuration
- SystemAggregateContext systemContext = runtime.getSystemContext();
- ModuleComponentConfigurationLoader loader = BootstrapHelper.getConfigurationLoader(systemContext, modelContext);
- ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT);
- AggregateContext context = BootstrapHelper.registerModule(systemContext, systemModuleComponent);
- context.fireEvent(EventContext.MODULE_START, null);
-
- // Load the SCDL configuration of the application module
- AggregateContext rootContext = runtime.getRootContext();
- moduleComponent = loader.loadModuleComponent(name, uri);
- moduleContext = BootstrapHelper.registerModule(rootContext, moduleComponent);
- }
-
- public ModuleComponent getModuleComponent() {
- return moduleComponent;
- }
-
- public AggregateContext getModuleContext() {
- return moduleContext;
- }
-
- /**
- * Start the runtime and associate the module context with the calling thread.
- */
- @Override
- public void start() {
- setModuleContext((ModuleContext) moduleContext);
- try {
- //moduleContext.start();
- moduleContext.fireEvent(EventContext.MODULE_START, null);
- moduleContext.fireEvent(EventContext.REQUEST_START, null);
- moduleContext.fireEvent(EventContext.SESSION_NOTIFY, sessionKey);
- monitor.started(moduleContext);
- } catch (CoreRuntimeException e) {
- setModuleContext(null);
- monitor.startFailed(moduleContext, e);
- //FIXME throw a better exception
- throw new ServiceRuntimeException(e);
- }
- }
-
- /**
- * Disassociate the module context from the current thread and shut down the runtime.
- */
- @Override
- public void stop() {
- setModuleContext(null);
- moduleContext.fireEvent(EventContext.REQUEST_END, null);
- moduleContext.fireEvent(EventContext.SESSION_END, sessionKey);
- moduleContext.fireEvent(EventContext.MODULE_STOP, null);
- moduleContext.stop();
- monitor.stopped(moduleContext);
- runtime.stop();
- monitor.stopped(runtime);
- }
-
- /**
- * Monitor interface for a TuscanyRuntime.
- */
- public static interface Monitor {
- /**
- * Event emitted after the runtime has been started.
- *
- * @param ctx the runtime's module component context
- */
- void started(AggregateContext ctx);
-
- /**
- * Event emitted when an attempt to start the runtime failed.
- *
- * @param ctx the runtime's module component context
- * @param e the exception that caused the failure
- */
- void startFailed(AggregateContext ctx, CoreRuntimeException e);
-
- /**
- * Event emitted after the runtime has been stopped.
- *
- * @param ctx the runtime's module component context
- */
- void stopped(AggregateContext ctx);
- }
-
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.tuscany;
+
+import java.util.List;
+
+import org.apache.tuscany.common.monitor.MonitorFactory;
+import org.apache.tuscany.common.monitor.impl.NullMonitorFactory;
+import org.apache.tuscany.core.builder.ContextFactoryBuilder;
+import org.apache.tuscany.core.builder.impl.DefaultWireBuilder;
+import org.apache.tuscany.core.config.ConfigurationException;
+import org.apache.tuscany.core.config.ModuleComponentConfigurationLoader;
+import org.apache.tuscany.core.context.AggregateContext;
+import org.apache.tuscany.core.context.CoreRuntimeException;
+import org.apache.tuscany.core.context.EventContext;
+import org.apache.tuscany.core.context.SystemAggregateContext;
+import org.apache.tuscany.core.runtime.RuntimeContext;
+import org.apache.tuscany.core.runtime.RuntimeContextImpl;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.ModuleComponent;
+import org.apache.tuscany.model.scdl.loader.SCDLModelLoader;
+import org.osoa.sca.ModuleContext;
+import org.osoa.sca.SCA;
+import org.osoa.sca.ServiceRuntimeException;
+
+public class TuscanyRuntime extends SCA {
+ private final TuscanyRuntime.Monitor monitor;
+ private final Object sessionKey = new Object();
+
+ private final RuntimeContext runtime;
+ private final AggregateContext moduleContext;
+
+ private final ModuleComponent moduleComponent;
+
+ private static final String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system";
+
+ /**
+ * Construct a runtime using a null MonitorFactory.
+ *
+ * @param name the name of the module component
+ * @param uri the URI to assign to the module component
+ * @throws ConfigurationException if there was a problem loading the SCA configuration
+ * @see TuscanyRuntime#TuscanyRuntime(String, String, org.apache.tuscany.common.monitor.MonitorFactory)
+ */
+ public TuscanyRuntime(String name, String uri) throws ConfigurationException {
+ this(name, uri,
+ Thread.currentThread().getContextClassLoader(),
+ new NullMonitorFactory());
+ }
+
+ /**
+ * Construct a runtime containing a single module component with the
+ * specified name. The module definition is loaded from a "/sca.module"
+ * resource found on the classpath of the current Thread context classloader.
+ *
+ * @param name the name of the module component
+ * @param uri the URI to assign to the module component
+ * @param classLoader the class loader to use for the assembly
+ * @param monitorFactory the MonitorFactory for this runtime
+ * @throws ConfigurationException if there was a problem loading the SCA configuration
+ */
+ public TuscanyRuntime(String name, String uri, ClassLoader classLoader, MonitorFactory monitorFactory) throws ConfigurationException {
+ this.monitor = monitorFactory.getMonitor(TuscanyRuntime.Monitor.class);
+
+ // Create an assembly model context
+ AssemblyModelContext modelContext = BootstrapHelper.getModelContext(classLoader);
+
+ // Create a runtime context and start it
+ List<SCDLModelLoader> loaders = modelContext.getAssemblyLoader().getLoaders();
+ List<ContextFactoryBuilder> configBuilders = BootstrapHelper.getBuilders();
+ runtime = new RuntimeContextImpl(monitorFactory, loaders, configBuilders, new DefaultWireBuilder());
+ runtime.start();
+ monitor.started(runtime);
+
+ // Load and start the system configuration
+ SystemAggregateContext systemContext = runtime.getSystemContext();
+ ModuleComponentConfigurationLoader loader = BootstrapHelper.getConfigurationLoader(systemContext, modelContext);
+ ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT);
+ AggregateContext context = BootstrapHelper.registerModule(systemContext, systemModuleComponent);
+ context.fireEvent(EventContext.MODULE_START, null);
+
+ // Load the SCDL configuration of the application module
+ AggregateContext rootContext = runtime.getRootContext();
+ moduleComponent = loader.loadModuleComponent(name, uri);
+ moduleContext = BootstrapHelper.registerModule(rootContext, moduleComponent);
+ }
+
+ public ModuleComponent getModuleComponent() {
+ return moduleComponent;
+ }
+
+ public AggregateContext getModuleContext() {
+ return moduleContext;
+ }
+
+ /**
+ * Start the runtime and associate the module context with the calling thread.
+ */
+ @Override
+ public void start() {
+ setModuleContext((ModuleContext) moduleContext);
+ try {
+ //moduleContext.start();
+ moduleContext.fireEvent(EventContext.MODULE_START, null);
+ moduleContext.fireEvent(EventContext.REQUEST_START, null);
+ moduleContext.fireEvent(EventContext.SESSION_NOTIFY, sessionKey);
+ monitor.started(moduleContext);
+ } catch (CoreRuntimeException e) {
+ setModuleContext(null);
+ monitor.startFailed(moduleContext, e);
+ //FIXME throw a better exception
+ throw new ServiceRuntimeException(e);
+ }
+ }
+
+ /**
+ * Disassociate the module context from the current thread and shut down the runtime.
+ */
+ @Override
+ public void stop() {
+ setModuleContext(null);
+ moduleContext.fireEvent(EventContext.REQUEST_END, null);
+ moduleContext.fireEvent(EventContext.SESSION_END, sessionKey);
+ moduleContext.fireEvent(EventContext.MODULE_STOP, null);
+ moduleContext.stop();
+ monitor.stopped(moduleContext);
+ runtime.stop();
+ monitor.stopped(runtime);
+ }
+
+ /**
+ * Monitor interface for a TuscanyRuntime.
+ */
+ public static interface Monitor {
+ /**
+ * Event emitted after the runtime has been started.
+ *
+ * @param ctx the runtime's module component context
+ */
+ void started(AggregateContext ctx);
+
+ /**
+ * Event emitted when an attempt to start the runtime failed.
+ *
+ * @param ctx the runtime's module component context
+ * @param e the exception that caused the failure
+ */
+ void startFailed(AggregateContext ctx, CoreRuntimeException e);
+
+ /**
+ * Event emitted after the runtime has been stopped.
+ *
+ * @param ctx the runtime's module component context
+ */
+ void stopped(AggregateContext ctx);
+ }
+
}
Propchange: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/pom.xml?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/pom.xml (original)
+++ incubator/servicemix/trunk/servicemix-services/pom.xml Thu Jul 27 22:49:32 2006
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright 2005 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!-- $Rev: 356052 $ $Date: 2005-12-11 14:41:20 -0800 (dim., 11 déc. 2005) $ -->
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix</artifactId>
- <version>3.0-incubating-SNAPSHOT</version>
- </parent>
-
- <artifactId>servicemix-services</artifactId>
- <packaging>jar</packaging>
- <name>ServiceMix :: Services</name>
- <description>Various services that can be used by the container or components</description>
-
- <dependencies>
- <dependency>
- <groupId>incubator-activemq</groupId>
- <artifactId>activeio-core</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jencks</groupId>
- <artifactId>jencks</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>tranql</groupId>
- <artifactId>tranql-connector</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>geronimo</groupId>
- <artifactId>geronimo-transaction</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>geronimo</groupId>
- <artifactId>geronimo-connector</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Rev: 356052 $ $Date: 2005-12-11 14:41:20 -0800 (dim., 11 déc. 2005) $ -->
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.servicemix</groupId>
+ <artifactId>servicemix</artifactId>
+ <version>3.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>servicemix-services</artifactId>
+ <packaging>jar</packaging>
+ <name>ServiceMix :: Services</name>
+ <description>Various services that can be used by the container or components</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>incubator-activemq</groupId>
+ <artifactId>activeio-core</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jencks</groupId>
+ <artifactId>jencks</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>tranql</groupId>
+ <artifactId>tranql-connector</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>geronimo</groupId>
+ <artifactId>geronimo-transaction</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>geronimo</groupId>
+ <artifactId>geronimo-connector</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
</project>
Propchange: incubator/servicemix/trunk/servicemix-services/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/id/IdGenerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapter.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapter.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapter.java Thu Jul 27 22:49:32 2006
@@ -1,50 +1,50 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc;
-
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-public interface JDBCAdapter {
-
- public void doCreateTables(Connection connection) throws SQLException, IOException;
-
- public void doDropTables(Connection connection) throws SQLException, IOException;
-
- public byte[] doLoadData(Connection connection, String id) throws SQLException, IOException;
-
- public byte[][] doLoadData(Connection connection, String[] ids) throws SQLException, IOException;
-
- public void doStoreData(Connection connection, String id, byte[] data) throws SQLException, IOException;
-
- public void doUpdateData(Connection connection, String id, byte[] data) throws SQLException, IOException;
-
- public void doRemoveData(Connection connection, String id) throws SQLException, IOException;
-
- public void doRemoveData(Connection connection, String[] ids) throws SQLException, IOException;
-
- public int doGetCount(Connection connection) throws SQLException, IOException;
-
- public String[] doGetIds(Connection connection) throws SQLException, IOException;
-
- public String[] doGetIds(Connection connection, int fromIndex, int toIndex) throws SQLException, IOException;
-
- public Statements getStatements();
-
- public void setStatements(Statements statements);
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public interface JDBCAdapter {
+
+ public void doCreateTables(Connection connection) throws SQLException, IOException;
+
+ public void doDropTables(Connection connection) throws SQLException, IOException;
+
+ public byte[] doLoadData(Connection connection, String id) throws SQLException, IOException;
+
+ public byte[][] doLoadData(Connection connection, String[] ids) throws SQLException, IOException;
+
+ public void doStoreData(Connection connection, String id, byte[] data) throws SQLException, IOException;
+
+ public void doUpdateData(Connection connection, String id, byte[] data) throws SQLException, IOException;
+
+ public void doRemoveData(Connection connection, String id) throws SQLException, IOException;
+
+ public void doRemoveData(Connection connection, String[] ids) throws SQLException, IOException;
+
+ public int doGetCount(Connection connection) throws SQLException, IOException;
+
+ public String[] doGetIds(Connection connection) throws SQLException, IOException;
+
+ public String[] doGetIds(Connection connection, int fromIndex, int toIndex) throws SQLException, IOException;
+
+ public Statements getStatements();
+
+ public void setStatements(Statements statements);
+
+}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapterFactory.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapterFactory.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapterFactory.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapterFactory.java Thu Jul 27 22:49:32 2006
@@ -1,74 +1,74 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.apache.activeio.util.FactoryFinder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jdbc.adapter.DefaultJDBCAdapter;
-
-public class JDBCAdapterFactory {
-
- private static final Log log = LogFactory.getLog(JDBCAdapterFactory.class);
- private static FactoryFinder factoryFinder = new FactoryFinder("META-INF/services/org/apache/servicemix/jdbc/");
-
- public static JDBCAdapter getAdapter(Connection connection) {
- JDBCAdapter adapter = null;
- try {
-
- // Make the filename file system safe.
- String driverName = connection.getMetaData().getDriverName();
- driverName = driverName.replaceAll("[^a-zA-Z0-9\\-]", "_").toLowerCase();
-
- try {
- adapter = (JDBCAdapter) factoryFinder.newInstance(driverName);
- log.info("Database driver recognized: [" + driverName + "]");
- } catch (Throwable e) {
- log.warn("Database driver NOT recognized: [" + driverName
- + "]. Will use default JDBC implementation.");
- }
-
- } catch (SQLException e) {
- log.warn("JDBC error occurred while trying to detect database type. Will use default JDBC implementation: "
- + e.getMessage());
- log("Failure details: ", e);
- }
-
- // Use the default JDBC adapter if the
- // Database type is not recognized.
- if (adapter == null) {
- adapter = new DefaultJDBCAdapter();
- }
-
- return adapter;
- }
-
- public static void log(String msg, SQLException e) {
- if (log.isDebugEnabled()) {
- if (log.isDebugEnabled()) {
- String s = msg + e.getMessage();
- while (e.getNextException() != null) {
- e = e.getNextException();
- s += ", due to: " + e.getMessage();
- }
- log.debug(s, e);
- }
- }
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.activeio.util.FactoryFinder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jdbc.adapter.DefaultJDBCAdapter;
+
+public class JDBCAdapterFactory {
+
+ private static final Log log = LogFactory.getLog(JDBCAdapterFactory.class);
+ private static FactoryFinder factoryFinder = new FactoryFinder("META-INF/services/org/apache/servicemix/jdbc/");
+
+ public static JDBCAdapter getAdapter(Connection connection) {
+ JDBCAdapter adapter = null;
+ try {
+
+ // Make the filename file system safe.
+ String driverName = connection.getMetaData().getDriverName();
+ driverName = driverName.replaceAll("[^a-zA-Z0-9\\-]", "_").toLowerCase();
+
+ try {
+ adapter = (JDBCAdapter) factoryFinder.newInstance(driverName);
+ log.info("Database driver recognized: [" + driverName + "]");
+ } catch (Throwable e) {
+ log.warn("Database driver NOT recognized: [" + driverName
+ + "]. Will use default JDBC implementation.");
+ }
+
+ } catch (SQLException e) {
+ log.warn("JDBC error occurred while trying to detect database type. Will use default JDBC implementation: "
+ + e.getMessage());
+ log("Failure details: ", e);
+ }
+
+ // Use the default JDBC adapter if the
+ // Database type is not recognized.
+ if (adapter == null) {
+ adapter = new DefaultJDBCAdapter();
+ }
+
+ return adapter;
+ }
+
+ public static void log(String msg, SQLException e) {
+ if (log.isDebugEnabled()) {
+ if (log.isDebugEnabled()) {
+ String s = msg + e.getMessage();
+ while (e.getNextException() != null) {
+ e = e.getNextException();
+ s += ", due to: " + e.getMessage();
+ }
+ log.debug(s, e);
+ }
+ }
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/JDBCAdapterFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/Statements.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/Statements.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/Statements.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/Statements.java Thu Jul 27 22:49:32 2006
@@ -1,213 +1,213 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc;
-
-/**
- * @version $Revision: 1.4 $
- *
- * @org.apache.xbean.XBean element="statements"
- *
- */
-public class Statements {
-
- private String tablePrefix = "";
- protected String storeTableName = "SM_STORE";
-
- protected String binaryDataType = "BLOB";
- protected String idDataType = "VARCHAR(48)";
- private String storeDataStatement;
- private String updateDataStatement;
- private String removeDataStatement;
- private String findDataStatement;
- private String findAllIdsStatement;
- private String findAllDataStatement;
- private String countStatement;
- private String[] createSchemaStatements;
- private String[] dropSchemaStatements;
-
- public String[] getCreateSchemaStatements() {
- if (createSchemaStatements == null) {
- createSchemaStatements = new String[] {
- "CREATE TABLE " + getFullStoreTableName() + "(" + "ID " + idDataType + " NOT NULL"
- + ", DATA " + binaryDataType
- + ", PRIMARY KEY ( ID ) )",
- };
- }
- return createSchemaStatements;
- }
-
- public String[] getDropSchemaStatements() {
- if (dropSchemaStatements == null) {
- dropSchemaStatements = new String[] {
- "DROP TABLE " + getFullStoreTableName() + "",
- };
- }
- return dropSchemaStatements;
- }
-
- public String getStoreDataStatement() {
- if (storeDataStatement == null) {
- storeDataStatement = "INSERT INTO " + getFullStoreTableName()
- + "(ID, DATA) VALUES (?, ?)";
- }
- return storeDataStatement;
- }
-
- public String getUpdateDataStatement() {
- if (updateDataStatement == null) {
- updateDataStatement = "UPDATE " + getFullStoreTableName() + " SET DATA=? WHERE ID=?";
- }
- return updateDataStatement;
- }
-
- public String getRemoveDataStatement() {
- if (removeDataStatement == null) {
- removeDataStatement = "DELETE FROM " + getFullStoreTableName() + " WHERE ID=?";
- }
- return removeDataStatement;
- }
-
- public String getFindDataStatement() {
- if (findDataStatement == null) {
- findDataStatement = "SELECT DATA FROM " + getFullStoreTableName() + " WHERE ID=?";
- }
- return findDataStatement;
- }
-
- public String getFindAllIdsStatement() {
- if (findAllIdsStatement == null) {
- findAllIdsStatement = "SELECT ID FROM " + getFullStoreTableName()
- + " ORDER BY ID";
- }
- return findAllIdsStatement;
- }
-
- public String getFindAllDataStatement() {
- if (findAllDataStatement == null) {
- findAllDataStatement = "SELECT ID, DATA FROM " + getFullStoreTableName()
- + " WHERE ORDER BY ID";
- }
- return findAllDataStatement;
- }
-
- public String getCountStatement() {
- if (countStatement == null) {
- countStatement = "SELECT COUNT(ID) FROM " + getFullStoreTableName();
- }
- return countStatement;
- }
-
- public String getFullStoreTableName() {
- return getTablePrefix() + getStoreTableName();
- }
-
- /**
- * @return Returns the messageDataType.
- */
- public String getBinaryDataType() {
- return binaryDataType;
- }
-
- /**
- * @param messageDataType
- * The messageDataType to set.
- */
- public void setBinaryDataType(String messageDataType) {
- this.binaryDataType = messageDataType;
- }
-
- /**
- * @return Returns the storeTableName.
- */
- public String getStoreTableName() {
- return storeTableName;
- }
-
- /**
- * @param storeTableName
- * The storeTableName to set.
- */
- public void setStoreTableName(String storeTableName) {
- this.storeTableName = storeTableName;
- }
-
- /**
- * @return Returns the idDataType.
- */
- public String getIdDataType() {
- return idDataType;
- }
-
- /**
- * @param idDataType
- * The idDataType to set.
- */
- public void setIdDataType(String msgIdDataType) {
- this.idDataType = msgIdDataType;
- }
-
- /**
- * @return Returns the tablePrefix.
- */
- public String getTablePrefix() {
- return tablePrefix;
- }
-
- /**
- * @param tablePrefix
- * The tablePrefix to set.
- */
- public void setTablePrefix(String tablePrefix) {
- this.tablePrefix = tablePrefix;
- }
-
- public void setStoreDataStatement(String addMessageStatment) {
- this.storeDataStatement = addMessageStatment;
- }
-
- public void setCreateSchemaStatements(String[] createSchemaStatments) {
- this.createSchemaStatements = createSchemaStatments;
- }
-
- public void setDropSchemaStatements(String[] dropSchemaStatments) {
- this.dropSchemaStatements = dropSchemaStatments;
- }
-
- public void setFindAllDataStatement(String findAllMessagesStatment) {
- this.findAllDataStatement = findAllMessagesStatment;
- }
-
- public void setFindDataStatement(String findMessageStatment) {
- this.findDataStatement = findMessageStatment;
- }
-
- public void setRemoveDataStatement(String removeMessageStatment) {
- this.removeDataStatement = removeMessageStatment;
- }
-
- public void setUpdateDataStatement(String updateMessageStatment) {
- this.updateDataStatement = updateMessageStatment;
- }
-
- public void setFindAllIdsStatement(String findAllIdsStatement) {
- this.findAllIdsStatement = findAllIdsStatement;
- }
-
- public void setCountStatement(String getCountStatement) {
- this.countStatement = getCountStatement;
- }
-
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc;
+
+/**
+ * @version $Revision: 1.4 $
+ *
+ * @org.apache.xbean.XBean element="statements"
+ *
+ */
+public class Statements {
+
+ private String tablePrefix = "";
+ protected String storeTableName = "SM_STORE";
+
+ protected String binaryDataType = "BLOB";
+ protected String idDataType = "VARCHAR(48)";
+ private String storeDataStatement;
+ private String updateDataStatement;
+ private String removeDataStatement;
+ private String findDataStatement;
+ private String findAllIdsStatement;
+ private String findAllDataStatement;
+ private String countStatement;
+ private String[] createSchemaStatements;
+ private String[] dropSchemaStatements;
+
+ public String[] getCreateSchemaStatements() {
+ if (createSchemaStatements == null) {
+ createSchemaStatements = new String[] {
+ "CREATE TABLE " + getFullStoreTableName() + "(" + "ID " + idDataType + " NOT NULL"
+ + ", DATA " + binaryDataType
+ + ", PRIMARY KEY ( ID ) )",
+ };
+ }
+ return createSchemaStatements;
+ }
+
+ public String[] getDropSchemaStatements() {
+ if (dropSchemaStatements == null) {
+ dropSchemaStatements = new String[] {
+ "DROP TABLE " + getFullStoreTableName() + "",
+ };
+ }
+ return dropSchemaStatements;
+ }
+
+ public String getStoreDataStatement() {
+ if (storeDataStatement == null) {
+ storeDataStatement = "INSERT INTO " + getFullStoreTableName()
+ + "(ID, DATA) VALUES (?, ?)";
+ }
+ return storeDataStatement;
+ }
+
+ public String getUpdateDataStatement() {
+ if (updateDataStatement == null) {
+ updateDataStatement = "UPDATE " + getFullStoreTableName() + " SET DATA=? WHERE ID=?";
+ }
+ return updateDataStatement;
+ }
+
+ public String getRemoveDataStatement() {
+ if (removeDataStatement == null) {
+ removeDataStatement = "DELETE FROM " + getFullStoreTableName() + " WHERE ID=?";
+ }
+ return removeDataStatement;
+ }
+
+ public String getFindDataStatement() {
+ if (findDataStatement == null) {
+ findDataStatement = "SELECT DATA FROM " + getFullStoreTableName() + " WHERE ID=?";
+ }
+ return findDataStatement;
+ }
+
+ public String getFindAllIdsStatement() {
+ if (findAllIdsStatement == null) {
+ findAllIdsStatement = "SELECT ID FROM " + getFullStoreTableName()
+ + " ORDER BY ID";
+ }
+ return findAllIdsStatement;
+ }
+
+ public String getFindAllDataStatement() {
+ if (findAllDataStatement == null) {
+ findAllDataStatement = "SELECT ID, DATA FROM " + getFullStoreTableName()
+ + " WHERE ORDER BY ID";
+ }
+ return findAllDataStatement;
+ }
+
+ public String getCountStatement() {
+ if (countStatement == null) {
+ countStatement = "SELECT COUNT(ID) FROM " + getFullStoreTableName();
+ }
+ return countStatement;
+ }
+
+ public String getFullStoreTableName() {
+ return getTablePrefix() + getStoreTableName();
+ }
+
+ /**
+ * @return Returns the messageDataType.
+ */
+ public String getBinaryDataType() {
+ return binaryDataType;
+ }
+
+ /**
+ * @param messageDataType
+ * The messageDataType to set.
+ */
+ public void setBinaryDataType(String messageDataType) {
+ this.binaryDataType = messageDataType;
+ }
+
+ /**
+ * @return Returns the storeTableName.
+ */
+ public String getStoreTableName() {
+ return storeTableName;
+ }
+
+ /**
+ * @param storeTableName
+ * The storeTableName to set.
+ */
+ public void setStoreTableName(String storeTableName) {
+ this.storeTableName = storeTableName;
+ }
+
+ /**
+ * @return Returns the idDataType.
+ */
+ public String getIdDataType() {
+ return idDataType;
+ }
+
+ /**
+ * @param idDataType
+ * The idDataType to set.
+ */
+ public void setIdDataType(String msgIdDataType) {
+ this.idDataType = msgIdDataType;
+ }
+
+ /**
+ * @return Returns the tablePrefix.
+ */
+ public String getTablePrefix() {
+ return tablePrefix;
+ }
+
+ /**
+ * @param tablePrefix
+ * The tablePrefix to set.
+ */
+ public void setTablePrefix(String tablePrefix) {
+ this.tablePrefix = tablePrefix;
+ }
+
+ public void setStoreDataStatement(String addMessageStatment) {
+ this.storeDataStatement = addMessageStatment;
+ }
+
+ public void setCreateSchemaStatements(String[] createSchemaStatments) {
+ this.createSchemaStatements = createSchemaStatments;
+ }
+
+ public void setDropSchemaStatements(String[] dropSchemaStatments) {
+ this.dropSchemaStatements = dropSchemaStatments;
+ }
+
+ public void setFindAllDataStatement(String findAllMessagesStatment) {
+ this.findAllDataStatement = findAllMessagesStatment;
+ }
+
+ public void setFindDataStatement(String findMessageStatment) {
+ this.findDataStatement = findMessageStatment;
+ }
+
+ public void setRemoveDataStatement(String removeMessageStatment) {
+ this.removeDataStatement = removeMessageStatment;
+ }
+
+ public void setUpdateDataStatement(String updateMessageStatment) {
+ this.updateDataStatement = updateMessageStatment;
+ }
+
+ public void setFindAllIdsStatement(String findAllIdsStatement) {
+ this.findAllIdsStatement = findAllIdsStatement;
+ }
+
+ public void setCountStatement(String getCountStatement) {
+ this.countStatement = getCountStatement;
+ }
+
}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/Statements.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/AxionJDBCAdapter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/AxionJDBCAdapter.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/AxionJDBCAdapter.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/AxionJDBCAdapter.java Thu Jul 27 22:49:32 2006
@@ -1,28 +1,28 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc.adapter;
-
-
-
-/**
- * Axion specific Adapter.
- *
- * @org.apache.xbean.XBean element="axionJDBCAdapter"
- * @version $Revision: 1.4 $
- */
-public class AxionJDBCAdapter extends StreamJDBCAdapter {
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc.adapter;
+
+
+
+/**
+ * Axion specific Adapter.
+ *
+ * @org.apache.xbean.XBean element="axionJDBCAdapter"
+ * @version $Revision: 1.4 $
+ */
+public class AxionJDBCAdapter extends StreamJDBCAdapter {
+
+}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/AxionJDBCAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java Thu Jul 27 22:49:32 2006
@@ -1,40 +1,40 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc.adapter;
-
-
-
-/**
- * This JDBCAdapter inserts and extracts BLOB data using the
- * getBlob()/setBlob() operations. This is a little more involved
- * since to insert a blob you have to:
- *
- * 1: insert empty blob.
- * 2: select the blob
- * 3: finally update the blob with data value.
- *
- * The databases/JDBC drivers that use this adapter are:
- * <ul>
- * <li></li>
- * </ul>
- *
- * @org.apache.xbean.XBean element="blobJDBCAdapter"
- *
- * @version $Revision: 1.2 $
- */
-public class BlobJDBCAdapter extends DefaultJDBCAdapter {
-
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc.adapter;
+
+
+
+/**
+ * This JDBCAdapter inserts and extracts BLOB data using the
+ * getBlob()/setBlob() operations. This is a little more involved
+ * since to insert a blob you have to:
+ *
+ * 1: insert empty blob.
+ * 2: select the blob
+ * 3: finally update the blob with data value.
+ *
+ * The databases/JDBC drivers that use this adapter are:
+ * <ul>
+ * <li></li>
+ * </ul>
+ *
+ * @org.apache.xbean.XBean element="blobJDBCAdapter"
+ *
+ * @version $Revision: 1.2 $
+ */
+public class BlobJDBCAdapter extends DefaultJDBCAdapter {
+
}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java Thu Jul 27 22:49:32 2006
@@ -1,49 +1,49 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc.adapter;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * This JDBCAdapter inserts and extracts BLOB data using the
- * setBytes()/getBytes() operations.
- *
- * The databases/JDBC drivers that use this adapter are:
- *
- * @org.apache.xbean.XBean element="bytesJDBCAdapter"
- *
- * @version $Revision: 1.2 $
- */
-public class BytesJDBCAdapter extends DefaultJDBCAdapter {
-
-
- /**
- * @see org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter#getBinaryData(java.sql.ResultSet, int)
- */
- protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException {
- return rs.getBytes(index);
- }
-
- /**
- * @see org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter#setBinaryData(java.sql.PreparedStatement, int, byte[])
- */
- protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws SQLException {
- s.setBytes(index, data);
- }
-
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc.adapter;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * This JDBCAdapter inserts and extracts BLOB data using the
+ * setBytes()/getBytes() operations.
+ *
+ * The databases/JDBC drivers that use this adapter are:
+ *
+ * @org.apache.xbean.XBean element="bytesJDBCAdapter"
+ *
+ * @version $Revision: 1.2 $
+ */
+public class BytesJDBCAdapter extends DefaultJDBCAdapter {
+
+
+ /**
+ * @see org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter#getBinaryData(java.sql.ResultSet, int)
+ */
+ protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException {
+ return rs.getBytes(index);
+ }
+
+ /**
+ * @see org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter#setBinaryData(java.sql.PreparedStatement, int, byte[])
+ */
+ protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws SQLException {
+ s.setBytes(index, data);
+ }
+
}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/DB2JDBCAdapter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/DB2JDBCAdapter.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/DB2JDBCAdapter.java (original)
+++ incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/DB2JDBCAdapter.java Thu Jul 27 22:49:32 2006
@@ -1,35 +1,35 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jdbc.adapter;
-
-import java.sql.Blob;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- *
- * @org.apache.xbean.XBean element="db2JDBCAdapter"
- *
- * @version $Revision: 1.2 $
- */
-public class DB2JDBCAdapter extends DefaultJDBCAdapter {
-
- protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException {
- // Get as a BLOB
- Blob aBlob = rs.getBlob(index);
- return aBlob.getBytes(1, (int) aBlob.length());
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jdbc.adapter;
+
+import java.sql.Blob;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ *
+ * @org.apache.xbean.XBean element="db2JDBCAdapter"
+ *
+ * @version $Revision: 1.2 $
+ */
+public class DB2JDBCAdapter extends DefaultJDBCAdapter {
+
+ protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException {
+ // Get as a BLOB
+ Blob aBlob = rs.getBlob(index);
+ return aBlob.getBytes(1, (int) aBlob.length());
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-services/src/main/java/org/apache/servicemix/jdbc/adapter/DB2JDBCAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native