diff --git a/openesb-standalone-container/Documentation/JDBC Connection parameters.xlsx b/openesb-standalone-container/Documentation/JDBC Connection parameters.xlsx
new file mode 100644
index 0000000..4d7b880
Binary files /dev/null and b/openesb-standalone-container/Documentation/JDBC Connection parameters.xlsx differ
diff --git a/openesb-standalone-container/Documentation/JDNI for OE SE.docx b/openesb-standalone-container/Documentation/JDNI for OE SE.docx
new file mode 100644
index 0000000..6af9463
Binary files /dev/null and b/openesb-standalone-container/Documentation/JDNI for OE SE.docx differ
diff --git a/openesb-standalone-framework/pom.xml b/openesb-standalone-container/pom.xml
similarity index 52%
rename from openesb-standalone-framework/pom.xml
rename to openesb-standalone-container/pom.xml
index 735a5ed..34091a7 100644
--- a/openesb-standalone-framework/pom.xml
+++ b/openesb-standalone-container/pom.xml
@@ -8,24 +8,35 @@
0.0.1-SNAPSHOT
- openesb-standalone-framework
+ openesb-standalone-container
- OpenESB - Standalone - Framework
- OpenESB runtime in standalone mode - Framework
+ OpenESB - Standalone - Container
+ OpenESB runtime in standalone mode - Container
+
+
+
+
+ org.codehaus.mojo
+ jaxb2-maven-plugin
+ 1.5
+
+
+ xjc
+
+ xjc
+
+
+
+
+ OEContext.xsd
+ ${project.basedir}/src/main/resources/net/openesb/standalone/naming/utils
+ net.openesb.standalone.naming.jaxb
+
+
+
+
-
-
- net.open-esb.runtime.standalone
- openesb-standalone-naming
- ${project.version}
-
-
- net.open-esb.runtime.standalone
- openesb-standalone-security
- ${project.version}
-
-
net.open-esb
@@ -45,6 +56,13 @@
${atomikos.version}
+
+
+ org.apache.shiro
+ shiro-core
+ ${shiro.version}
+
+
+
+ org.apache.tomcat
+ tomcat-jdbc
+ ${tomcat.version}
+
+
+ org.apache.tomcat
+ tomcat-catalina
+ ${tomcat.version}
+ runtime
+
+
junit
junit
diff --git a/openesb-standalone-framework/src/main/java/net/openesb/standalone/framework/JSEJBIFramework.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/framework/JSEJBIFramework.java
similarity index 100%
rename from openesb-standalone-framework/src/main/java/net/openesb/standalone/framework/JSEJBIFramework.java
rename to openesb-standalone-container/src/main/java/net/openesb/standalone/framework/JSEJBIFramework.java
diff --git a/openesb-standalone-framework/src/main/java/net/openesb/standalone/framework/JSEJBIFrameworkMBean.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/framework/JSEJBIFrameworkMBean.java
similarity index 100%
rename from openesb-standalone-framework/src/main/java/net/openesb/standalone/framework/JSEJBIFrameworkMBean.java
rename to openesb-standalone-container/src/main/java/net/openesb/standalone/framework/JSEJBIFrameworkMBean.java
diff --git a/openesb-standalone-framework/src/main/java/net/openesb/standalone/framework/JSEPlatformContext.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/framework/JSEPlatformContext.java
similarity index 100%
rename from openesb-standalone-framework/src/main/java/net/openesb/standalone/framework/JSEPlatformContext.java
rename to openesb-standalone-container/src/main/java/net/openesb/standalone/framework/JSEPlatformContext.java
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/DataSourcePoolFactory.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/DataSourcePoolFactory.java
new file mode 100644
index 0000000..e45851d
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/DataSourcePoolFactory.java
@@ -0,0 +1,17 @@
+package net.openesb.standalone.naming.jndi;
+
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+import net.openesb.standalone.naming.jaxb.DataSourcePoolPropertiesComplexType;
+
+/**
+ *
+ * @author Paul PEREZ (paul.perez at pymma.com)
+ * @author OpenESB Community
+ */
+public interface DataSourcePoolFactory {
+
+ public DataSource getDataSource (DataSourcePoolPropertiesComplexType dSPProperties) ;
+ public XADataSource getXADataSource (DataSourcePoolPropertiesComplexType dSPProperties) ;
+
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/impl/InitialContexFactoryImpl.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/impl/InitialContexFactoryImpl.java
new file mode 100644
index 0000000..80ef67d
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/impl/InitialContexFactoryImpl.java
@@ -0,0 +1,221 @@
+package net.openesb.standalone.naming.jndi.impl;
+
+import net.openesb.standalone.naming.jndi.tomcat.TomcatDataSourcePoolFactory;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import javax.naming.spi.InitialContextFactory;
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import net.openesb.standalone.naming.jaxb.DataSourcePoolPropertiesComplexType;
+import net.openesb.standalone.naming.jaxb.JdbcResourceComplexType;
+import net.openesb.standalone.naming.jaxb.OeContextComplexType;
+import net.openesb.standalone.naming.jndi.DataSourcePoolFactory;
+import net.openesb.standalone.naming.utils.I18NBundle;
+
+/**
+ *
+ * @author Paul PEREZ (paul.perez at pymma.com)
+ * @author OpenESB Community
+ */
+public class InitialContexFactoryImpl implements InitialContextFactory {
+
+ public static final String DATASOURCE_TYPE = "Datasource";
+ public static final String XADATASOURCE_TYPE = "XADatasource";
+ private static final Logger sLogger = Logger.getLogger("net.openesb.standalone.naming");
+ private final Map mDSPMap = new HashMap();
+ private final DataSourcePoolFactory mDSPFactory = new TomcatDataSourcePoolFactory();
+ private final String mClassName = "InitialContexFactoryImpl";
+ private final ResourceBundle mResourceBundle;
+ private String mMessage;
+
+ // Constructor
+ public InitialContexFactoryImpl() {
+
+ I18NBundle nBundle = new I18NBundle("net.openesb.standalone.naming.utils");
+ mResourceBundle = nBundle.getBundle();
+ }
+
+ /* Regarding the exception management, If the context file if not correct,
+ * I choosed to return an initial context in any case even empty. So if input data
+ is not correct, I log this information but catch the exception in order to return
+ an initial context. Another policy would be to stop at any exception. I did not choose
+ it. Naming exception will be thrown only if I cannot create the initial context */
+ /* The initial context I use is the one found in Tomcat 7 */
+ @Override
+ public Context getInitialContext(Hashtable, ?> environment) throws NamingException {
+ Map datasourceMap = new HashMap();
+ String methodName = "getInitialContext";
+ /*Context initialisation Just set the system properties and use the class InitialContext*/
+ System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");
+ System.setProperty(Context.URL_PKG_PREFIXES, "org.apache.naming");
+ Context initialContext = new InitialContext();
+ mMessage = mResourceBundle.getString("context.created");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage);
+
+ /* Second step read the XML file URL where context configuration is described
+ * The URL can be file:// http:// ...
+ * The XML File URL must be in environement hashmap and read the key URL must be equal to
+ * CONTEXT_URL*/
+ String urlValue = null;
+ if (environment.containsKey(Context.PROVIDER_URL)) {
+ urlValue = (String) environment.get(Context.PROVIDER_URL);
+ mMessage = mResourceBundle.getString("context.url.read");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{urlValue});
+ } else {
+ mMessage = mResourceBundle.getString("context.url.not.provided") + " " + mResourceBundle.getString("context.url.not.provided.ID");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage);
+ }
+
+ /* Read the context from the URL */
+ @SuppressWarnings("UnusedAssignment") JAXBElement root = null;
+ try {
+ JAXBContext jc = JAXBContext.newInstance("net.openesb.standalone.naming.jaxb");
+ Unmarshaller unmarshaller = jc.createUnmarshaller();
+ root = (JAXBElement) unmarshaller.unmarshal(new URL(urlValue));
+ } catch (MalformedURLException ex) {
+ mMessage = mResourceBundle.getString("url.context.name.malformed") ;
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, new Object[] {urlValue});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, ex);
+ return initialContext ;
+ } catch (JAXBException ex) {
+ mMessage = mResourceBundle.getString("jaxb.unmarshalling.failed");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, new Object[] {urlValue});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, ex);
+ return initialContext ;
+ }
+
+ // This must be made with the xml file has an element root
+ // Log level Fine Unmarshalling ok
+ OeContextComplexType oeContext = root.getValue();
+ mMessage = mResourceBundle.getString("context.binding.ok");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage);
+
+ /* OeContext contains the complete context */
+ /* I create a map with the datasourcePool Name as key and datasourcePool as Value
+ * This will be useful to instanciate the db connector later.
+ */
+ List dataSourcePoolList = oeContext.getDataSourcePoolProperties();
+ int listSize = dataSourcePoolList.size();
+ mMessage = mResourceBundle.getString("number.dataSourcePoolProperties.found");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{listSize});
+
+
+ //Loop on dataSourcePoolList iterator
+ for (DataSourcePoolPropertiesComplexType dspComplexType : dataSourcePoolList) {
+ mDSPMap.put(dspComplexType.getDbConnectorName(), dspComplexType);
+ mMessage = mResourceBundle.getString("datasourcepoolproperties.found.in.context");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{dspComplexType.getDbConnectorName()});
+ }
+
+ // Now Let's read JdbcResource
+ List jdbcResourceList = oeContext.getJdbcResources();
+ listSize = jdbcResourceList.size();
+ mMessage = mResourceBundle.getString("number.jdbcResource.declaration.found");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{listSize});
+
+ //Loop on JDBCResourceList iterator
+ for (JdbcResourceComplexType jdbcResource : jdbcResourceList) {
+ /* For each jcbc resource I want to associate a dbConnector.
+ * DBConnector provide a connectionPool or a XAConnectionPool
+ * I instanciate the dbConnetor in a lazy mode (when needed)
+ * Once instanciated dbConnector are put in a map for reusing purpose
+ * ex: when two JNDI names target the same dbConnector
+ */
+
+ // Get JNDI Name
+ String jndiName = jdbcResource.getJndiName();
+ mMessage = jndiName + " " + mResourceBundle.getString("in.process");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage);
+
+
+ /* Check if this JNDI name is already in the context. In that case the
+ * second instance is not taken into account
+ */
+ try {
+ initialContext.lookup(jndiName);
+ mMessage = mResourceBundle.getString("jndi.value.already.defined");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{jndiName});
+ continue;
+ } catch (NamingException ex) {
+ // Nothing else to do. Having an exception is the normal process
+ }
+
+
+ /* Create datasource or XA Datasource thanks to the underlying dbConnector
+ * DBConnector refeence is in the DataSourcePoolProperties. DBConnector are instanciated
+ * dynamically and must be present in the classpath
+ * */
+ String dbConnectorName = jdbcResource.getDbConnectorName();
+ /* check if the datasource has been created already for a previous
+ * JNDI Name. In that case we reuse it.
+ */
+ if (datasourceMap.containsKey(dbConnectorName)) {
+ if (datasourceMap.get(dbConnectorName) instanceof XADataSource) {
+ initialContext.rebind(jndiName, (XADataSource) datasourceMap.get(dbConnectorName));
+ } else {
+ initialContext.rebind(jndiName, datasourceMap.get(dbConnectorName));
+ }
+ continue;
+ }
+
+ // Retrieve DataSourcePoolPropertie
+ DataSourcePoolPropertiesComplexType dspProperties = mDSPMap.get(dbConnectorName);
+ // Check if Datasourse or XA Datasource
+ if (dspProperties.getResourceType().equals(InitialContexFactoryImpl.DATASOURCE_TYPE)) {
+ mMessage = mResourceBundle.getString("datasource.in.process");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{jndiName});
+ DataSource dataSource = mDSPFactory.getDataSource(dspProperties);
+ /* Check if datasource is not null then put in the context since exception are catch */
+ if (null != dataSource) {
+ datasourceMap.put(dbConnectorName, dataSource);
+ try {
+ initialContext.rebind(jndiName, dataSource);
+ } catch (NamingException ex) {
+ initialContext.bind(jndiName, dataSource);
+ }
+ mMessage = mResourceBundle.getString("datasource.processed.bind.success");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{jndiName});
+ }
+
+ } else if (dspProperties.getResourceType()
+ .equals(InitialContexFactoryImpl.XADATASOURCE_TYPE)) {
+ mMessage = mResourceBundle.getString("xadatasource.in.process");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{jndiName});
+ XADataSource xaDataSource = mDSPFactory.getXADataSource(dspProperties);
+ if (null != xaDataSource) {
+ /* Store the XAdatasource in a map for reusing purpose see above */
+ datasourceMap.put(dbConnectorName, (DataSource) xaDataSource);
+ initialContext.rebind(jndiName, xaDataSource);
+ mMessage = mResourceBundle.getString("xadatasource.processed.bind.success");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{jndiName});
+ }
+ } else {
+ mMessage = mResourceBundle.getString("bad.resource.type");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{dspProperties.getResourceType(), dspProperties.getDatabaseName()});
+
+ }
+ }
+
+ /* the context contains the binding and the datasource or xaDatasource links
+ * Return the context
+ */
+ return initialContext;
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/tomcat/TomcatDataSourcePoolFactory.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/tomcat/TomcatDataSourcePoolFactory.java
new file mode 100644
index 0000000..3bc3024
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/jndi/tomcat/TomcatDataSourcePoolFactory.java
@@ -0,0 +1,311 @@
+package net.openesb.standalone.naming.jndi.tomcat;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+import javax.xml.bind.JAXBElement;
+import net.openesb.standalone.naming.jaxb.DataSourcePoolPropertiesComplexType;
+import net.openesb.standalone.naming.jaxb.DataSourcePropertiesComplexType;
+import net.openesb.standalone.naming.jaxb.PoolPropertiesComplexType;
+import net.openesb.standalone.naming.jaxb.PropertyComplexType;
+import net.openesb.standalone.naming.jndi.DataSourcePoolFactory;
+import net.openesb.standalone.naming.utils.I18NBundle;
+import org.apache.tomcat.jdbc.pool.PoolProperties;
+
+/**
+ *
+ * @author Paul PEREZ (paul.perez at pymma.com)
+ * @author OpenESB Community
+ */
+public class TomcatDataSourcePoolFactory implements DataSourcePoolFactory {
+
+ private final ResourceBundle mResourceBundle;
+ private String mMessage;
+ private final String mClassName = "DataSourcePoolFactoryimpl";
+ private static final Logger sLogger = Logger.getLogger("net.openesb.standalone.naming");
+
+ public TomcatDataSourcePoolFactory() {
+ I18NBundle nBundle = new I18NBundle("net.openesb.standalone.naming.utils");
+ mResourceBundle = nBundle.getBundle();
+ }
+
+ @Override
+ /* GetDatasource method is used to create dynamically and set up a pooled datasource. Information and parameters
+ * are provided by dspProperties. The first part of the method create dynamically a native datasource.
+ * Introspection is used to set up datasource properties. We setup just the properties declared in
+ * context.xml (or else).
+ * Using the same way, the second part setup Apache pool. Important: Pool Datasource property is
+ * set up with the native datasource, so there is no need for setting up other pool properties
+ * related to the connection.
+ * Then we create an Apache datasource with the pool as parameter
+ */
+ public DataSource getDataSource(DataSourcePoolPropertiesComplexType dspProperties) {
+ PoolProperties poolProperties = this.createNativeDataSource(dspProperties);
+ org.apache.tomcat.jdbc.pool.DataSource ds = new org.apache.tomcat.jdbc.pool.DataSource(poolProperties);
+ ds.setName(dspProperties.getDbConnectorName());
+ registerMBean(ds);
+
+ return ds;
+ }
+
+ @Override
+ public XADataSource getXADataSource(DataSourcePoolPropertiesComplexType dspProperties) {
+ PoolProperties poolProperties = this.createNativeDataSource(dspProperties);
+ org.apache.tomcat.jdbc.pool.XADataSource ds = new org.apache.tomcat.jdbc.pool.XADataSource(poolProperties);
+ ds.setName(dspProperties.getDbConnectorName());
+ registerMBean(ds);
+
+ return ds;
+ }
+
+ private void registerMBean(org.apache.tomcat.jdbc.pool.DataSource ds) {
+ try {
+ ds.createPool();
+ ds.setJmxEnabled(true);
+
+ MBeanServer mBeanServer = java.lang.management.ManagementFactory.getPlatformMBeanServer();
+
+ String mBeanName = "net.open-esb.standalone:type=DataSources,name=" + ds.getName();
+ mBeanServer.registerMBean(ds.getPool().getJmxPool(), new ObjectName(mBeanName));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private PoolProperties createNativeDataSource(DataSourcePoolPropertiesComplexType dspProperties) {
+ String methodName = "createNativeDataSource";
+
+ /* get the properties for the native Datasource. it is not created yet*/
+ DataSourcePropertiesComplexType dataSourceProperties = dspProperties.getDataSourceProperties();
+ Map datasourceMap = this.listToMap(dataSourceProperties.getProperty());
+
+ /* Get datasource name from OE Context. Native DS is create dynamically
+ * so the class must be present in the classpath. DS Instance not created yet
+ */
+ String dsName = dspProperties.getDatasourceClassname();
+ mMessage = mResourceBundle.getString("start.instanciate.datasource");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{dsName});
+ Class> dsClass;
+ try {
+ dsClass = Class.forName(dsName);
+ } catch (ClassNotFoundException ex) {
+ mMessage = mResourceBundle.getString("datasource.class.not.found");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, new Object[]{dsName});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, ex);
+ /* An exception don't stop JNDI context process so we return a null Datasource. */
+ return null;
+ }
+
+ /*Return Fields declared in a class and its ancesters */
+ Map dsFields = this.getAllFields(dsClass);
+ /*Create datasource instance. This is the instance that will be set with reflexion and returned
+ * to the caller
+ */
+
+ Object nativeDS;
+ try {
+ nativeDS = dsClass.newInstance();
+ } catch (InstantiationException ex) {
+ mMessage = mResourceBundle.getString("impossible.instanciate.datasource");
+ sLogger.logp(Level.SEVERE, mClassName, methodName, mMessage, new Object[]{dsName});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, ex);
+ return null;
+ } catch (IllegalAccessException ex) {
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, ex);
+ return null;
+ }
+
+ /* Use java reflexion to set up Native Datasource declared in the context */
+ Set dspSet = datasourceMap.keySet();
+ Iterator keys = dspSet.iterator();
+ while (keys.hasNext()) {
+ String fieldName = keys.next();
+ Field field = dsFields.get(fieldName);
+ if (null == field) {
+ mMessage = mResourceBundle.getString("invalid.field.name");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName, dsName});
+ } else {
+ if (!field.isAccessible()) {
+ field.setAccessible(true);
+ }
+ String fieldValue = datasourceMap.get(fieldName);
+ try {
+ if (field.getType().equals(byte.class)) {
+ field.set(nativeDS, Byte.parseByte(fieldValue));
+ } else if (field.getType().equals(boolean.class)) {
+ field.set(nativeDS, Boolean.parseBoolean(fieldValue));
+ } else if (field.getType().equals(char.class)) {
+ field.set(nativeDS, fieldValue.charAt(0));
+ } else if (field.getType().equals(short.class)) {
+ field.set(nativeDS, Short.parseShort(fieldValue));
+ } else if (field.getType().equals(int.class)) {
+ field.set(nativeDS, Integer.parseInt(fieldValue));
+ } else if (field.getType().equals(long.class)) {
+ field.set(nativeDS, Long.parseLong(fieldValue));
+ } else if (field.getType().equals(float.class)) {
+ field.set(nativeDS, Float.parseFloat(fieldValue));
+ } else if (field.getType().equals(double.class)) {
+ field.set(nativeDS, Double.parseDouble(fieldValue));
+ } else if (field.getType().equals(String.class)) {
+ field.set(nativeDS, fieldValue);
+ } else {
+ mMessage = mResourceBundle.getString("field.not.set");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName});
+ mMessage = mResourceBundle.getString("field.type.not.process");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName, dsName, field.getType()});
+ }
+ } catch (IllegalArgumentException ex) {
+ mMessage = mResourceBundle.getString("field.not.set");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, ex);
+ } catch (IllegalAccessException ex) {
+ mMessage = mResourceBundle.getString("field.not.set");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, ex);
+ }
+ }
+ }
+
+ /* Datasouce fields are set with data proterties found in the context
+ * Now let's set the pool with the pool proterties found in the context
+ * get the properties for the pool */
+ mMessage = mResourceBundle.getString("native.datasource.set.succesfully");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage, new Object[]{dsName});
+
+ /**
+ * ** Set up Pool
+ */
+ mMessage = mResourceBundle.getString("start.pool.configuration");
+ sLogger.logp(Level.FINE, mClassName, methodName, mMessage);
+ PoolPropertiesComplexType contextPoolProperties = dspProperties.getPoolProperties();
+ Map poolMap = this.listToMap(contextPoolProperties.getProperty());
+ // Create pool configuration
+ org.apache.tomcat.jdbc.pool.PoolProperties poolProperties = new PoolProperties();
+ Class poolPropertiesClass = poolProperties.getClass();
+ Map poolPropertiesFields = this.getAllFields(poolPropertiesClass);
+ /* Use java reflexion to set up pool configurationwith context properties
+ */
+ Set poolPropertiesSet = poolMap.keySet();
+ keys = poolPropertiesSet.iterator();
+
+ while (keys.hasNext()) {
+
+ String fieldName = keys.next();
+ Field field = poolPropertiesFields.get(fieldName);
+ if (null == field) {
+ mMessage = mResourceBundle.getString("invalid.field.name");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName, poolPropertiesClass});
+ } else {
+ if (!field.isAccessible()) {
+ field.setAccessible(true);
+ }
+ String fieldValue = poolMap.get(fieldName);
+ try {
+ if (field.getType().equals(byte.class)) {
+ field.set(poolProperties, Byte.parseByte(fieldValue));
+ } else if (field.getType().equals(boolean.class)) {
+ field.set(poolProperties, Boolean.parseBoolean(fieldValue));
+ } else if (field.getType().equals(char.class)) {
+ field.set(poolProperties, fieldValue.charAt(0));
+ } else if (field.getType().equals(short.class)) {
+ field.set(poolProperties, Short.parseShort(fieldValue));
+ } else if (field.getType().equals(int.class)) {
+ field.set(poolProperties, Integer.parseInt(fieldValue));
+ } else if (field.getType().equals(long.class)) {
+ field.set(poolProperties, Long.parseLong(fieldValue));
+ } else if (field.getType().equals(float.class)) {
+ field.set(poolProperties, Float.parseFloat(fieldValue));
+ } else if (field.getType().equals(double.class)) {
+ field.set(poolProperties, Double.parseDouble(fieldValue));
+ } else if (field.getType().equals(String.class)) {
+ field.set(poolProperties, fieldValue);
+ } else {
+ mMessage = mResourceBundle.getString("field.not.set");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName});
+ mMessage = mResourceBundle.getString("field.type.not.process");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName, poolPropertiesClass, field.getType()});
+ }
+ } catch (IllegalArgumentException ex) {
+ mMessage = mResourceBundle.getString("field.not.set");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, ex);
+ } catch (IllegalAccessException ex) {
+ mMessage = mResourceBundle.getString("field.not.set");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, new Object[]{fieldName});
+ mMessage = mResourceBundle.getString("catch.exception");
+ sLogger.logp(Level.INFO, mClassName, methodName, mMessage, ex);
+ }
+ }
+ }
+ // set the pool and get a Poolled Datasource
+ poolProperties.setDataSource(nativeDS);
+ poolProperties.setJmxEnabled(true);
+
+ return poolProperties;
+ }
+
+ /* List to Map is an internal methode used to convert a List to a Map.
+ * Map will be use to set the DataSource and the Pool
+ */
+ private Map listToMap(List inputList) {
+ Map outputMap = new HashMap();
+ Iterator it = inputList.iterator();
+ while (it.hasNext()) {
+ PropertyComplexType prop = it.next();
+ List> nameAndValueAndDescription = prop.getNameAndValueAndDescription();
+ Iterator> it2 = nameAndValueAndDescription.iterator();
+ String key = null, value = null;
+ while (it2.hasNext()) {
+ JAXBElement element = it2.next();
+ String localpart = element.getName().getLocalPart();
+ if ("name".equals(localpart)) {
+ key = element.getValue();
+ } else if ("value".equals(localpart)) {
+ value = element.getValue();
+ }
+ // Put the key valu in the Map
+ outputMap.put(key, value);
+ }
+ }
+ return outputMap;
+ }
+
+ /* getAll field is used to get all the fields declared in a class + its ancesters
+ * getDeclaredField just returns the field declared at the class level and not
+ * at the ancester levels. The retured map contains key-values pairs with Field name and Field object
+ */
+ private Map getAllFields(Class> type) {
+ List listFields = new ArrayList();
+ for (Class> c = type; c
+ != Object.class; c = c.getSuperclass()) {
+ listFields.addAll(Arrays.asList(c.getDeclaredFields()));
+ }
+ Map mapFields = new HashMap();
+ Iterator fieldIterator = listFields.iterator();
+
+ while (fieldIterator.hasNext()) {
+ Field field = fieldIterator.next();
+ String fieldName = field.getName();
+ mapFields.put(fieldName, field);
+ }
+ return mapFields;
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/test/TestConnection01.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/test/TestConnection01.java
new file mode 100644
index 0000000..1e70de7
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/test/TestConnection01.java
@@ -0,0 +1,79 @@
+package net.openesb.standalone.naming.test;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Hashtable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import net.openesb.standalone.naming.jndi.impl.InitialContexFactoryImpl;
+import javax.naming.spi.InitialContextFactory;
+import javax.sql.DataSource;
+
+/**
+ *
+ * @author Paul PEREZ (paul.perez at pymma.com)
+ * @author OpenESB Community
+ */
+public class TestConnection01 {
+
+ public static void main(String[] args) throws Exception{
+ InitialContextFactory factory = new InitialContexFactoryImpl();
+ Hashtable environment = new Hashtable();
+ environment.put(Context.PROVIDER_URL, "file:///G:/projects/jndi-standalone/jndi-standalone/src/main/resources/net/openesb/standalone/naming/utils/OEContextSample.xml");
+
+ Context context = null;
+ try {
+ context = factory.getInitialContext(environment);
+ } catch (NamingException ex) {
+ Logger.getLogger(TestConnection01.class.getName()).log(Level.SEVERE, null, ex);
+ System.out.println("Get initial context Error");
+ System.exit(1);
+ }
+
+ DataSource dsMySQL = null;
+ try {
+ dsMySQL = (DataSource) context.lookup("MySQLServer01");
+ } catch (NamingException ex) {
+ Logger.getLogger(TestConnection01.class.getName()).log(Level.SEVERE, null, ex);
+ System.out.println("Look up Error");
+ System.exit(1);
+ }
+ Connection connectionMySQL = null;
+ try {
+ connectionMySQL = dsMySQL.getConnection();
+ PreparedStatement sta2 = connectionMySQL.prepareStatement("SELECT * FROM test.test");
+ ResultSet rs = sta2.executeQuery();
+ rs.next();
+ String name = rs.getString("NAME");
+ System.out.println(name);
+ } catch (SQLException ex) {
+ Logger.getLogger(TestConnection01.class.getName()).log(Level.SEVERE, null, ex);
+ System.out.println("Look up Error");
+ System.exit(1);
+ }
+
+
+ // Derby test
+ DataSource dsDerby = (DataSource)context.lookup("Derby01");
+ Connection connectionDerby = dsDerby.getConnection();
+ PreparedStatement staDerby = connectionDerby.prepareStatement("select * from APP.CUSTOMER where CUSTOMER_ID=1");
+ ResultSet rsDerby = staDerby.executeQuery();
+ rsDerby.next();
+ String customerID = rsDerby.getString("NAME");
+ System.out.println(customerID);
+
+ //PostGresql test
+ DataSource dsPostgres = (DataSource)context.lookup("Postgres01");
+ Connection connectionPG = dsPostgres.getConnection();
+ PreparedStatement staPG = connectionPG.prepareStatement("SELECT * FROM public.distributors");
+ ResultSet rsPG = staPG.executeQuery();
+ rsPG.next();
+ String customerName = rsPG.getString(2);
+ System.out.println(customerName);
+
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/Bundle.properties b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/Bundle.properties
new file mode 100644
index 0000000..a6df13a
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/Bundle.properties
@@ -0,0 +1,28 @@
+context.created=Empty JNDI Context has been created
+context.url.not.provided.ID=NAMING-0001
+context.url.not.provided=The URL context context is not provided.
+context.url.read=The URL for the context has been retrieved and its value is {0}
+url.context.name.malformed.ID=NAMING-0002
+url.context.name.malformed=The URL {0} provided for the context is malformed
+jaxb.unmarshalling.failed=UNMarshalling failed with the provided URL {0}
+context.binding.ok=context binding is successful and the data have been unmarshaled
+number.dataSourcePoolProperties.found={0} DataSourcePool properties have been found in the context
+datasourcepoolproperties.found.in.context=DatasourcePoolProperties {0} has been found in the context
+number.jdbcResource.declaration.found={0} JDBC Resources have defined in the context
+in.process=in process
+datasource.created.succesfully=A datasource has been created successfully for the JNDI Name {0}
+jndi.value.already.defined=The JNDI value {0} has been declare more than once. Just the first declaration is taken into account
+datasource.in.process=Creation Datasource for {0} in process
+datasource.processed.bind.success=Datasource for {0} has been processed and bind with success
+xadatasource.in.process=Creation XADatasource for {0} in process
+xadatasource.processed.bind.success=XADatasource for {0} has been processed and bind with success
+bad.resource.type=The resource type {0} defined in the datasourcePoolProperties {1} is not supported
+start.instanciate.datasource=Start datasource {0} instanciation
+datasource.class.not.found=Datasource class {0} is not found, please check OpenESB classpath
+impossible.instanciate.datasource=Impossible to instanciate the datasource {0}
+catch.exception=The following exception has been catch
+invalid.field.name=Field name "{0}" does not exist in the class {1} please check class and ancestor content and context properties.
+field.type.not.process= The field {0} in the class {1} is a not supported type {2}. Just set filed with primitive and String type.
+field.not.set=The field {0} has not been set.
+native.datasource.set.succesfully=Native datasource {0} has been set successfully
+start.pool.configuration= Start pool configuration
\ No newline at end of file
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/I18NBundle.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/I18NBundle.java
new file mode 100644
index 0000000..4c5ffdd
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/I18NBundle.java
@@ -0,0 +1,184 @@
+package net.openesb.standalone.naming.utils;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * This class reads the i18n strings from locale specific bundle from the
+ * Bundle[locale].properties or bundle[locale].properties file in a specified
+ * package. This class has methods for formating the messages.
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class I18NBundle {
+
+ private final Logger sLogger = Logger.getLogger("net.openesb.standalone.naming");
+ /**
+ * package name
+ */
+ private String mBundlePackageName = null;
+ /**
+ * resource bundle
+ */
+ private ResourceBundle mBundle = null;
+
+
+
+ /**
+ * constructor
+ *
+ * @param packageName packe name ( e.g. com.sun.mypackage ) in which to look
+ * for Bundle.properties file
+ */
+ public I18NBundle(String packageName) {
+ this.mBundlePackageName = packageName;
+ this.mBundle = null;
+ }
+
+ /**
+ * loads the bundle
+ *
+ * @param bundleName bundle name
+ * @param packageName packe name ( e.g. com.sun.mypackage ) in which to look
+ * for Bundle.properties file
+ */
+ private void loadBundle(String packageName, String bundleName) {
+
+ String bundleBaseName = packageName + "." + bundleName;
+ ResourceBundle resBundle = null;
+ try {
+ resBundle = ResourceBundle.getBundle(bundleBaseName);
+ } catch (MissingResourceException ex) {
+ // Try with locale independent defaultBundle
+ try {
+ resBundle = ResourceBundle.getBundle(bundleBaseName, new Locale(""));
+ } catch (Exception anyEx) {
+ sLogger.log(Level.FINE, anyEx.getMessage());
+ }
+ }
+
+ if (resBundle != null) {
+ this.mBundle = resBundle;
+ }
+ }
+
+ /**
+ * gets the loaded resource bundle
+ *
+ * @return resource bundle
+ */
+ public ResourceBundle getBundle() {
+ // lazzy init
+ if (this.mBundle == null) {
+ loadBundle(this.mBundlePackageName, "Bundle");
+ // try to load the bundle with lower case first letter
+ if (this.mBundle == null) {
+ loadBundle(this.mBundlePackageName, "bundle");
+ }
+ }
+ return this.mBundle;
+ }
+
+ /**
+ * gets the i18n message
+ *
+ * @param aI18NMsg String.
+ * @param aArgs Object[]
+ * @return formated i18n string.
+ */
+ public static String getFormattedMessage(
+ String aI18NMsg, Object[] aArgs) {
+ String formattedI18NMsg = aI18NMsg;
+ try {
+ MessageFormat mf = new MessageFormat(aI18NMsg);
+ formattedI18NMsg = mf.format(aArgs);
+ } catch (Exception ex) {
+ }
+ return formattedI18NMsg;
+ }
+
+ /**
+ * gets the i18n message
+ *
+ * @param aI18NKey i18n key
+ * @param anArgsArray array of arguments for the formatted string
+ * @return formatted i18n string
+ */
+ public String getMessage(String aI18NKey, Object[] anArgsArray) {
+ String i18nMessage = getBundle().getString(aI18NKey);
+ if (anArgsArray != null) {
+ return getFormattedMessage(i18nMessage, anArgsArray);
+ } else {
+ return i18nMessage;
+ }
+ }
+
+ /**
+ * gets the i18n message
+ *
+ * @param aI18NKey i18n key
+ * @return i18n string
+ */
+ public String getMessage(String aI18NKey) {
+ return getMessage(aI18NKey, null);
+ }
+
+ /**
+ * gets the i18n message
+ *
+ * @param aI18NKey i18n key
+ * @param arg1 argrument object to message
+ * @return i18n string
+ */
+ public String getMessage(String aI18NKey, Object arg1) {
+ Object[] args = {arg1};
+ return getMessage(aI18NKey, args);
+ }
+
+ /**
+ * gets the i18n message
+ *
+ * @param aI18NKey i18n key
+ * @param arg1 argrument object to message
+ * @param arg2 argrument object to message
+ * @return i18n string
+ */
+ public String getMessage(String aI18NKey, Object arg1, Object arg2) {
+ Object[] args = {arg1, arg2};
+ return getMessage(aI18NKey, args);
+ }
+
+ /**
+ * gets the i18n message
+ *
+ * @param aI18NKey i18n key
+ * @param arg1 argrument object to message
+ * @param arg2 argrument object to message
+ * @param arg3 argrument object to message
+ * @return i18n string
+ */
+ public String getMessage(String aI18NKey, Object arg1, Object arg2, Object arg3) {
+ Object[] args = {arg1, arg2, arg3};
+ return getMessage(aI18NKey, args);
+ }
+
+ /**
+ * main
+ *
+ * @param args string array.
+ */
+ public static void main(String[] args) {
+ Locale l = new Locale("");
+ System.out.println("Locale : " + l);
+ System.out.println("Default Locale : " + Locale.getDefault());
+ I18NBundle bundle = new I18NBundle("net.openesb.standalone.naming.utils");
+ bundle.loadBundle("net.openesb.standalone.naming.utils","toto");
+ System.out.println(
+ bundle.getMessage("jbi.ui.ant.jmx.msg.jmxmp.connected", new String[]{"xyz"}));
+ }
+}
\ No newline at end of file
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContext.xml b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContext.xml
new file mode 100644
index 0000000..a1486a0
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContext.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+ Derby Connector
+ org.apache.derby.jdbc.ClientDataSource40
+ Datasource
+ DERBY
+ OpenESB Community
+ 10.7.1.1
+ DBConnector for Derby
+
+
+ user
+ app
+
+
+
+ password
+ app
+
+
+
+ serverName
+ localhost
+
+
+
+ portNumber
+ 1527
+
+
+
+ databaseName
+ sample
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 10
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ Derby Connector
+ Derby01
+ Datasource connection to Derby
+
+
+
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContext.xsd b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContext.xsd
new file mode 100644
index 0000000..3bcd09b
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContext.xsd
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Datasource
+
+
+
+
+ XADatasource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContextSample.xml b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContextSample.xml
new file mode 100644
index 0000000..b2a29c1
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/naming/utils/OEContextSample.xml
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+ MYSQL Connector
+ com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+ Datasource
+ MYSQL
+ Oracle
+ 5.6
+ DBConnector for MySQL
+
+
+ user
+ root
+
+
+
+ password
+ password
+
+
+
+ hostName
+ localhost
+
+
+
+ port
+ 3306
+
+
+
+ databaseName
+ test
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 11
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ Derby Connector
+ org.apache.derby.jdbc.ClientDataSource40
+ Datasource
+ DERBY
+ OpenESB Community
+ 10.7.1.1
+ DBConnector for Derby
+
+
+ user
+ app
+
+
+
+ password
+ app
+
+
+
+ serverName
+ localhost
+
+
+
+ portNumber
+ 1527
+
+
+
+ databaseName
+ sample
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 10
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ Postgres Connector
+ org.postgresql.ds.PGSimpleDataSource
+ Datasource
+ POSTGRESQL
+ Postgres
+ 9.1-90
+ DBConnector for postgres
+
+
+ user
+ postgres
+
+
+
+ password
+ password
+
+
+
+ serverName
+ localhost
+
+
+
+ portNumber
+ 5432
+
+
+
+ databaseName
+ postgres
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 10
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ MYSQL Connector
+ MySQLServer01
+ Datasource connection to MySQ
+
+
+
+ Derby Connector
+ Derby01
+ Datasource connection to Derby
+
+
+
+ Postgres Connector
+ Postgres01
+ Datasource connection to Postgres
+
+
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/SecurityProviderImpl.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/SecurityProviderImpl.java
new file mode 100644
index 0000000..1e9dd04
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/SecurityProviderImpl.java
@@ -0,0 +1,82 @@
+package net.openesb.standalone.security;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.security.auth.Subject;
+import net.openesb.security.AuthenticationException;
+import net.openesb.security.AuthenticationToken;
+import net.openesb.security.SecurityProvider;
+import net.openesb.standalone.security.realm.Realm;
+import net.openesb.standalone.security.realm.RealmBuilder;
+import net.openesb.standalone.security.realm.shiro.ShiroAuthenticator;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class SecurityProviderImpl implements SecurityProvider {
+
+ private final Logger mLog =
+ Logger.getLogger(this.getClass().getPackage().getName());
+
+ private final static String MANAGEMENT_REALM = "admin";
+
+ private final Map realms = new HashMap();
+ private final ShiroAuthenticator authenticator = new ShiroAuthenticator();
+
+ public SecurityProviderImpl(Map> realmsConfiguration) {
+ this.init(realmsConfiguration);
+ }
+
+ private void init(Map> realmsConfiguration) {
+ if (realmsConfiguration != null) {
+ mLog.log(Level.INFO, "Loading security realms from configuration.");
+
+ for(Map.Entry> realmConfig : realmsConfiguration.entrySet()) {
+ if (! realms.containsKey(realmConfig.getKey())) {
+ Realm realm = RealmBuilder.
+ realmBuilder().
+ build(realmConfig.getKey(), realmConfig.getValue());
+
+ authenticator.loadRealm(realm);
+ realms.put(realmConfig.getKey(), realm);
+
+ if (realm.getName().equals(MANAGEMENT_REALM)) {
+ mLog.log(Level.INFO, "Management Realm ({0}) has been correctly configured.",
+ realmConfig.getKey());
+ } else {
+ mLog.log(Level.INFO, "Realm {0} has been correctly configured.",
+ realmConfig.getKey());
+ }
+ } else {
+ mLog.log(Level.INFO, "Realm {0} is already defined, skipping...",
+ realmConfig.getKey());
+ }
+ }
+ } else {
+ mLog.log(Level.WARNING, "No realm defined. Please have a look to "
+ + " the configuration !");
+ }
+ }
+
+ @Override
+ public Collection getRealms() {
+ return Collections.unmodifiableSet(
+ realms.keySet());
+ }
+
+ @Override
+ public Subject login(String realmName, AuthenticationToken authenticationToken) throws AuthenticationException {
+ return authenticator.authenticate(realmName, authenticationToken);
+ }
+
+ @Override
+ public Subject login(AuthenticationToken authenticationToken) throws AuthenticationException {
+ return login(MANAGEMENT_REALM, authenticationToken);
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/auth/login/JMXauthenticator.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/auth/login/JMXauthenticator.java
new file mode 100644
index 0000000..40da503
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/auth/login/JMXauthenticator.java
@@ -0,0 +1,42 @@
+package net.openesb.standalone.security.auth.login;
+
+import javax.management.remote.JMXAuthenticator;
+import javax.security.auth.Subject;
+import net.openesb.security.AuthenticationException;
+import net.openesb.security.AuthenticationToken;
+import net.openesb.security.SecurityProvider;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class JMXauthenticator implements JMXAuthenticator {
+
+ private final SecurityProvider securityProvider;
+
+ public JMXauthenticator(final SecurityProvider securityProvider) {
+ this.securityProvider = securityProvider;
+ }
+
+ @Override
+ public Subject authenticate(Object credentialsObj) {
+ final String [] credentials = (String []) credentialsObj;
+
+ try {
+ return securityProvider.login(new AuthenticationToken() {
+ @Override
+ public Object getPrincipal() {
+ return credentials[0];
+ }
+
+ @Override
+ public Object getCredentials() {
+ return credentials[1];
+ }
+ });
+ } catch (AuthenticationException ae) {
+ throw new SecurityException(ae.getMessage());
+ }
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/AbstractRealm.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/AbstractRealm.java
new file mode 100644
index 0000000..eb12e41
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/AbstractRealm.java
@@ -0,0 +1,26 @@
+package net.openesb.standalone.security.realm;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public abstract class AbstractRealm implements Realm {
+
+ private String realmName;
+
+ protected AbstractRealm() {
+ }
+
+ protected AbstractRealm(String realmName) {
+ this.realmName = realmName;
+ }
+
+ public String getName() {
+ return realmName;
+ }
+
+ public void setName(String realmName) {
+ this.realmName = realmName;
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/Realm.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/Realm.java
new file mode 100644
index 0000000..41e4607
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/Realm.java
@@ -0,0 +1,11 @@
+package net.openesb.standalone.security.realm;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public interface Realm {
+
+ String getName();
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/RealmBuilder.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/RealmBuilder.java
new file mode 100644
index 0000000..9a19ae2
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/RealmBuilder.java
@@ -0,0 +1,33 @@
+package net.openesb.standalone.security.realm;
+
+import java.util.Map;
+import java.util.ServiceLoader;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public final class RealmBuilder {
+
+ private final static String REALM_TYPE = "type";
+
+ public static RealmBuilder realmBuilder() {
+ return new RealmBuilder();
+ }
+
+ public Realm build(String realmName, Map properties) {
+ ServiceLoader handlers = ServiceLoader.load(RealmHandler.class);
+ for(RealmHandler handler : handlers) {
+ String type = properties.get(REALM_TYPE);
+ if (handler.canHandle(type)) {
+ Realm realm = handler.create(realmName, properties);
+
+ return realm;
+ }
+ }
+
+ throw new IllegalStateException("Unable to create realm " + realmName +
+ " : no handler found !");
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/RealmHandler.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/RealmHandler.java
new file mode 100644
index 0000000..aea8778
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/RealmHandler.java
@@ -0,0 +1,15 @@
+package net.openesb.standalone.security.realm;
+
+import java.util.Map;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public interface RealmHandler {
+
+ boolean canHandle(String type);
+
+ T create(String realmName, Map properties);
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/AbstractRealmHandler.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/AbstractRealmHandler.java
new file mode 100644
index 0000000..38d4af6
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/AbstractRealmHandler.java
@@ -0,0 +1,55 @@
+package net.openesb.standalone.security.realm.impl;
+
+import java.util.Map;
+import net.openesb.standalone.security.realm.Realm;
+import net.openesb.standalone.security.realm.RealmHandler;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public abstract class AbstractRealmHandler implements RealmHandler {
+
+ @Override
+ public T create(String realmName, Map properties) {
+ return instantiate(realmName, properties);
+ }
+
+ abstract T instantiate(String realmName, Map properties);
+
+ /**
+ * System property replacement in the given string.
+ *
+ * @param str The original string
+ * @return the modified string
+ */
+ protected String replace(String str) {
+ String result = str;
+ int pos_start = str.indexOf("${");
+ if (pos_start >= 0) {
+ StringBuilder builder = new StringBuilder();
+ int pos_end = -1;
+ while (pos_start >= 0) {
+ builder.append(str, pos_end + 1, pos_start);
+ pos_end = str.indexOf('}', pos_start + 2);
+ if (pos_end < 0) {
+ pos_end = pos_start - 1;
+ break;
+ }
+ String propName = str.substring(pos_start + 2, pos_end);
+ String replacement = propName.length() > 0 ? System
+ .getProperty(propName) : null;
+ if (replacement != null) {
+ builder.append(replacement);
+ } else {
+ builder.append(str, pos_start, pos_end + 1);
+ }
+ pos_start = str.indexOf("${", pos_end + 1);
+ }
+ builder.append(str, pos_end + 1, str.length());
+ result = builder.toString();
+ }
+ return result;
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/PropertiesRealm.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/PropertiesRealm.java
new file mode 100644
index 0000000..53e8a0e
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/PropertiesRealm.java
@@ -0,0 +1,48 @@
+package net.openesb.standalone.security.realm.impl;
+
+import net.openesb.standalone.security.realm.AbstractRealm;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class PropertiesRealm extends AbstractRealm {
+
+ private String path;
+
+ private boolean reload = false;
+
+ /**
+ * Unit: seconds
+ */
+ private int reloadInterval;
+
+ public PropertiesRealm(String realmName) {
+ super(realmName);
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public boolean isReload() {
+ return reload;
+ }
+
+ public void setReload(boolean reload) {
+ this.reload = reload;
+ }
+
+ public int getReloadInterval() {
+ return reloadInterval;
+ }
+
+ public void setReloadInterval(int reloadInterval) {
+ this.reloadInterval = reloadInterval;
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/PropertiesRealmHandler.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/PropertiesRealmHandler.java
new file mode 100644
index 0000000..b8a0fe3
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/impl/PropertiesRealmHandler.java
@@ -0,0 +1,61 @@
+package net.openesb.standalone.security.realm.impl;
+
+import java.io.File;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class PropertiesRealmHandler extends AbstractRealmHandler {
+
+ private final Logger mLog =
+ Logger.getLogger(this.getClass().getPackage().getName());
+
+ private final static String PROPERTIES_REALM = "properties";
+
+ private final static String PROPERTY_PATH = "file";
+ private final static String PROPERTY_RELOAD_ENABLE = "reload";
+ private final static String PROPERTY_RELOAD_INTERVAL = "interval";
+
+ @Override
+ public boolean canHandle(String type) {
+ return PROPERTIES_REALM.equalsIgnoreCase(type);
+ }
+
+ @Override
+ public PropertiesRealm instantiate(String realmName, Map properties) {
+ String file = properties.get(PROPERTY_PATH);
+ file = replace(file);
+
+ mLog.log(Level.INFO, "Creating properties realm using file: {0}", file);
+
+ File propertyFile = new File(file);
+ if (! propertyFile.exists()) {
+ mLog.log(Level.SEVERE, "Properties realm, invalid path: {0}",
+ propertyFile.getAbsolutePath());
+
+ throw new IllegalStateException("Properties realm, invalid path: " +
+ propertyFile.getAbsolutePath());
+ }
+
+ boolean reload = Boolean.parseBoolean(properties.get(PROPERTY_RELOAD_ENABLE));
+ PropertiesRealm propertiesRealm = new PropertiesRealm(realmName);
+ propertiesRealm.setPath(propertyFile.getAbsolutePath());
+
+ if (reload) {
+ String sInterval = properties.get(PROPERTY_RELOAD_INTERVAL);
+ try {
+ int interval = Integer.parseInt(sInterval);
+ propertiesRealm.setReloadInterval(interval);
+ } catch (NumberFormatException nfe) {
+
+ }
+ }
+
+ return propertiesRealm;
+ }
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/PropertiesRealmConverter.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/PropertiesRealmConverter.java
new file mode 100644
index 0000000..856fd5f
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/PropertiesRealmConverter.java
@@ -0,0 +1,35 @@
+package net.openesb.standalone.security.realm.shiro;
+
+import net.openesb.standalone.security.realm.Realm;
+import org.apache.shiro.realm.text.PropertiesRealm;
+
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class PropertiesRealmConverter implements
+ RealmConverter {
+
+ @Override
+ public PropertiesRealm convert(net.openesb.standalone.security.realm.impl.PropertiesRealm realm) {
+ PropertiesRealm cRealm = new PropertiesRealm();
+ cRealm.setResourcePath(realm.getPath());
+
+ if (realm.isReload()) {
+ cRealm.setReloadIntervalSeconds(realm.getReloadInterval());
+ }
+
+ // Initialize the realm
+ cRealm.onInit();
+
+ return cRealm;
+ }
+
+ @Override
+ public boolean canHandle(Class extends Realm> realm) {
+ return realm.equals(net.openesb.standalone.security.realm.impl.PropertiesRealm.class);
+ }
+
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/RealmConverter.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/RealmConverter.java
new file mode 100644
index 0000000..e96bdf3
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/RealmConverter.java
@@ -0,0 +1,15 @@
+package net.openesb.standalone.security.realm.shiro;
+
+import net.openesb.standalone.security.realm.Realm;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public interface RealmConverter {
+
+ S convert(T realm);
+
+ boolean canHandle(Class extends Realm> realm);
+}
diff --git a/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/ShiroAuthenticator.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/ShiroAuthenticator.java
new file mode 100644
index 0000000..5ddea11
--- /dev/null
+++ b/openesb-standalone-container/src/main/java/net/openesb/standalone/security/realm/shiro/ShiroAuthenticator.java
@@ -0,0 +1,59 @@
+package net.openesb.standalone.security.realm.shiro;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.logging.Logger;
+import javax.security.auth.Subject;
+import net.openesb.security.AuthenticationException;
+import net.openesb.security.AuthenticationToken;
+import net.openesb.standalone.security.realm.Realm;
+import net.openesb.standalone.security.realm.RealmHandler;
+import net.openesb.standalone.security.realm.impl.PropertiesRealm;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.mgt.DefaultSecurityManager;
+
+/**
+ *
+ * @author David BRASSELY (brasseld at gmail.com)
+ * @author OpenESB Community
+ */
+public class ShiroAuthenticator {
+
+ private final Logger mLog =
+ Logger.getLogger(this.getClass().getPackage().getName());
+
+ private final Map securityManagers =
+ new HashMap();
+
+ public void loadRealm(Realm realm) {
+ ServiceLoader converters = ServiceLoader.load(RealmConverter.class);
+ for (RealmConverter converter : converters) {
+ if (converter.canHandle(realm.getClass())) {
+ org.apache.shiro.realm.Realm sRealm = converter.convert((PropertiesRealm)realm);
+ DefaultSecurityManager manager = new DefaultSecurityManager(sRealm);
+ securityManagers.put(realm.getName(), manager);
+ }
+ }
+ }
+
+ public Subject authenticate(String realmName, AuthenticationToken authenticationToken)
+ throws AuthenticationException {
+ org.apache.shiro.mgt.SecurityManager securityManager = securityManagers.get(realmName);
+ org.apache.shiro.subject.Subject currentUser =
+ new org.apache.shiro.subject.Subject.Builder(securityManager).buildSubject();
+
+ UsernamePasswordToken token = new UsernamePasswordToken(
+ (String) authenticationToken.getPrincipal(),
+ (char []) authenticationToken.getCredentials());
+
+ try {
+ currentUser.login(token);
+
+ Subject subject = new Subject();
+ return subject;
+ } catch (org.apache.shiro.authc.AuthenticationException ae) {
+ throw new AuthenticationException(ae.getMessage());
+ }
+ }
+}
diff --git a/openesb-standalone-framework/src/main/java/net/openesb/standalone/settings/ImmutableSettings.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/settings/ImmutableSettings.java
similarity index 100%
rename from openesb-standalone-framework/src/main/java/net/openesb/standalone/settings/ImmutableSettings.java
rename to openesb-standalone-container/src/main/java/net/openesb/standalone/settings/ImmutableSettings.java
diff --git a/openesb-standalone-framework/src/main/java/net/openesb/standalone/settings/Settings.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/settings/Settings.java
similarity index 100%
rename from openesb-standalone-framework/src/main/java/net/openesb/standalone/settings/Settings.java
rename to openesb-standalone-container/src/main/java/net/openesb/standalone/settings/Settings.java
diff --git a/openesb-standalone-framework/src/main/java/net/openesb/standalone/settings/SettingsException.java b/openesb-standalone-container/src/main/java/net/openesb/standalone/settings/SettingsException.java
similarity index 100%
rename from openesb-standalone-framework/src/main/java/net/openesb/standalone/settings/SettingsException.java
rename to openesb-standalone-container/src/main/java/net/openesb/standalone/settings/SettingsException.java
diff --git a/openesb-standalone-container/src/main/resources/META-INF/services/net.openesb.standalone.security.realm.RealmHandler b/openesb-standalone-container/src/main/resources/META-INF/services/net.openesb.standalone.security.realm.RealmHandler
new file mode 100644
index 0000000..420fe6d
--- /dev/null
+++ b/openesb-standalone-container/src/main/resources/META-INF/services/net.openesb.standalone.security.realm.RealmHandler
@@ -0,0 +1 @@
+net.openesb.standalone.security.realm.impl.PropertiesRealmHandler
\ No newline at end of file
diff --git a/openesb-standalone-container/src/main/resources/META-INF/services/net.openesb.standalone.security.realm.shiro.RealmConverter b/openesb-standalone-container/src/main/resources/META-INF/services/net.openesb.standalone.security.realm.shiro.RealmConverter
new file mode 100644
index 0000000..8eb6772
--- /dev/null
+++ b/openesb-standalone-container/src/main/resources/META-INF/services/net.openesb.standalone.security.realm.shiro.RealmConverter
@@ -0,0 +1 @@
+net.openesb.standalone.security.realm.shiro.PropertiesRealmConverter
\ No newline at end of file
diff --git a/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/Bundle.properties b/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/Bundle.properties
new file mode 100644
index 0000000..15cbbe6
--- /dev/null
+++ b/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/Bundle.properties
@@ -0,0 +1,28 @@
+context.created=Empty JNDI Context has been created
+context.url.not.provided.ID=NAMING-0001
+context.url.not.provided=The URL context context is not provided.
+context.url.read=The URL for the context has been retrieved and its value is {0}
+url.context.name.malformed.ID=NAMING-0002
+url.context.name.malformed=The URL {0} provided for the context is malformed
+jaxb.unmarshalling.failed=Unmarshalling failed with the provided URL {0}
+context.binding.ok=context binding is successful and the data have been unmarshaled
+number.dataSourcePoolProperties.found={0} DataSourcePool properties have been found in the context
+datasourcepoolproperties.found.in.context=DatasourcePoolProperties {0} has been found in the context
+number.jdbcResource.declaration.found={0} JDBC Resources have defined in the context
+in.process=in process
+datasource.created.succesfully=A datasource has been created successfully for the JNDI Name {0}
+jndi.value.already.defined=The JNDI value {0} has been declare more than once. Just the first declaration is taken into account
+datasource.in.process=Creation Datasource for {0} in process
+datasource.processed.bind.success=Datasource for {0} has been processed and bind with success
+xadatasource.in.process=Creation XADatasource for {0} in process
+xadatasource.processed.bind.success=XADatasource for {0} has been processed and bind with success
+bad.resource.type=The resource type {0} defined in the datasourcePoolProperties {1} is not supported
+start.instanciate.datasource=Start datasource {0} instanciation
+datasource.class.not.found=Datasource class {0} is not found, please check OpenESB classpath
+impossible.instanciate.datasource=Impossible to instanciate the datasource {0}
+catch.exception=The following exception has been catch
+invalid.field.name=Field name "{0}" does not exist in the class {1} please check class and ancestor content and context properties.
+field.type.not.process= The field {0} in the class {1} is a not supported type {2}. Just set filed with primitive and String type.
+field.not.set=The field {0} has not been set.
+native.datasource.set.succesfully=Native datasource {0} has been set successfully
+start.pool.configuration= Start pool configuration
\ No newline at end of file
diff --git a/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/OEContext.xsd b/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/OEContext.xsd
new file mode 100644
index 0000000..3bcd09b
--- /dev/null
+++ b/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/OEContext.xsd
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Datasource
+
+
+
+
+ XADatasource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/OEContextSample.xml b/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/OEContextSample.xml
new file mode 100644
index 0000000..b2a29c1
--- /dev/null
+++ b/openesb-standalone-container/src/main/resources/net/openesb/standalone/naming/utils/OEContextSample.xml
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+ MYSQL Connector
+ com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+ Datasource
+ MYSQL
+ Oracle
+ 5.6
+ DBConnector for MySQL
+
+
+ user
+ root
+
+
+
+ password
+ password
+
+
+
+ hostName
+ localhost
+
+
+
+ port
+ 3306
+
+
+
+ databaseName
+ test
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 11
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ Derby Connector
+ org.apache.derby.jdbc.ClientDataSource40
+ Datasource
+ DERBY
+ OpenESB Community
+ 10.7.1.1
+ DBConnector for Derby
+
+
+ user
+ app
+
+
+
+ password
+ app
+
+
+
+ serverName
+ localhost
+
+
+
+ portNumber
+ 1527
+
+
+
+ databaseName
+ sample
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 10
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ Postgres Connector
+ org.postgresql.ds.PGSimpleDataSource
+ Datasource
+ POSTGRESQL
+ Postgres
+ 9.1-90
+ DBConnector for postgres
+
+
+ user
+ postgres
+
+
+
+ password
+ password
+
+
+
+ serverName
+ localhost
+
+
+
+ portNumber
+ 5432
+
+
+
+ databaseName
+ postgres
+
+
+
+
+
+ initialSize
+ 11
+
+
+
+ maxActive
+ 20
+
+
+
+ maxIdle
+ 10
+
+
+
+ minIdle
+ 10
+
+
+
+
+
+
+ MYSQL Connector
+ MySQLServer01
+ Datasource connection to MySQ
+
+
+
+ Derby Connector
+ Derby01
+ Datasource connection to Derby
+
+
+
+ Postgres Connector
+ Postgres01
+ Datasource connection to Postgres
+
+
diff --git a/openesb-standalone-packaging/pom.xml b/openesb-standalone-packaging/pom.xml
index 443f215..34c1c42 100644
--- a/openesb-standalone-packaging/pom.xml
+++ b/openesb-standalone-packaging/pom.xml
@@ -49,17 +49,7 @@
net.open-esb.runtime.standalone
- openesb-standalone-framework
- ${project.version}
-
-
- net.open-esb.runtime.standalone
- openesb-standalone-naming
- ${project.version}
-
-
- net.open-esb.runtime.standalone
- openesb-standalone-security
+ openesb-standalone-container
${project.version}
diff --git a/openesb-standalone-packaging/src/main/assembly/distribution.xml b/openesb-standalone-packaging/src/main/assembly/distribution.xml
index 83685a0..60cd9df 100644
--- a/openesb-standalone-packaging/src/main/assembly/distribution.xml
+++ b/openesb-standalone-packaging/src/main/assembly/distribution.xml
@@ -108,10 +108,8 @@
true
- net.open-esb.runtime.standalone:openesb-standalone-framework
net.open-esb.runtime.standalone:openesb-standalone-bootstrap
- net.open-esb.runtime.standalone:openesb-standalone-naming
- net.open-esb.runtime.standalone:openesb-standalone-security
+ net.open-esb.runtime.standalone:openesb-standalone-container
false
diff --git a/pom.xml b/pom.xml
index d9ea42b..6c1be7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,11 +17,9 @@
OpenESB runtime in standalone mode
- openesb-standalone-framework
+ openesb-standalone-container
openesb-standalone-bootstrap
- openesb-standalone-naming
openesb-standalone-packaging
- openesb-standalone-security