App Server support for base
https://sourceforge.net/tracker/?func=detail&aid=2700937&group_id=176962&atid=879334
This commit is contained in:
parent
fdc26ca69c
commit
c539b46b06
|
@ -7,7 +7,6 @@
|
||||||
<classpathentry kind="lib" path="/tools/lib/ant.jar"/>
|
<classpathentry kind="lib" path="/tools/lib/ant.jar"/>
|
||||||
<classpathentry kind="lib" path="/tools/lib/jpedal.jar"/>
|
<classpathentry kind="lib" path="/tools/lib/jpedal.jar"/>
|
||||||
<classpathentry kind="lib" path="/tools/lib/jnlp.jar"/>
|
<classpathentry kind="lib" path="/tools/lib/jnlp.jar"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
|
|
||||||
<classpathentry kind="lib" path="/tools/lib/junit.jar"/>
|
<classpathentry kind="lib" path="/tools/lib/junit.jar"/>
|
||||||
<classpathentry kind="lib" path="/jboss/client/jbossall-client.jar"/>
|
<classpathentry kind="lib" path="/jboss/client/jbossall-client.jar"/>
|
||||||
<classpathentry kind="lib" path="/tools/lib/postgresql.jar"/>
|
<classpathentry kind="lib" path="/tools/lib/postgresql.jar"/>
|
||||||
|
|
|
@ -62,4 +62,5 @@ Export-Package: org.adempiere.apps.graph,
|
||||||
org.compiere.util,
|
org.compiere.util,
|
||||||
org.compiere.wf
|
org.compiere.wf
|
||||||
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
|
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
|
||||||
org.adempiere.tools;bundle-version="0.0.0"
|
org.adempiere.tools;bundle-version="0.0.0",
|
||||||
|
org.adempiere.jboss;bundle-version="0.0.0"
|
||||||
|
|
|
@ -1,26 +1,6 @@
|
||||||
source.base.jar = src/
|
source.base.jar = src/,build/
|
||||||
bin.includes = META-INF/,\
|
bin.includes = META-INF/,\
|
||||||
../tools/lib/commons-net-1.4.0.jar,\
|
|
||||||
../tools/lib/ant.jar,\
|
|
||||||
../tools/lib/jpedal.jar,\
|
|
||||||
../tools/lib/jnlp.jar,\
|
|
||||||
../tools/lib/junit.jar,\
|
|
||||||
client/jbossall-client.jar,\
|
|
||||||
../tools/lib/postgresql.jar,\
|
|
||||||
../tools/lib/ocrs12.jar,\
|
|
||||||
../tools/lib/ojdbc14.jar,\
|
|
||||||
../tools/lib/c3p0-0.9.1.2.jar,\
|
|
||||||
../tools/lib/script-api.jar,\
|
|
||||||
../tools/lib/barbecue-1.5-beta1.jar,\
|
|
||||||
../tools/lib/poi-3.0.1-FINAL-20070705.jar,\
|
|
||||||
../tools/lib/jcommon-1.0.14.jar,\
|
|
||||||
../tools/lib/jfreechart-1.0.11.jar,\
|
|
||||||
../tools/lib/swingx-0.9.0.jar,\
|
|
||||||
../tools/lib/looks-2.0.4.jar,\
|
|
||||||
../tools/lib/commons-collections-3.1.jar,\
|
|
||||||
../tools/lib/activemq-core-5.0.0.jar,\
|
|
||||||
base.jar,\
|
base.jar,\
|
||||||
lib/looks-2.0.4.jar,\
|
|
||||||
plugin.xml
|
plugin.xml
|
||||||
jars.extra.classpath = platform:/plugin/org.adempiere.tools/lib/activation.jar,\
|
jars.extra.classpath = platform:/plugin/org.adempiere.tools/lib/activation.jar,\
|
||||||
platform:/plugin/org.adempiere.tools/lib/activemq-core-5.0.0.jar,\
|
platform:/plugin/org.adempiere.tools/lib/activemq-core-5.0.0.jar,\
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<property name="dist.dir" value="."/>
|
<property name="dist.dir" value="."/>
|
||||||
<property name="jar.path" value="../lib"/>
|
<property name="jar.path" value="../lib"/>
|
||||||
<property name="jar.name" value="Base"/>
|
<property name="jar.name" value="Base"/>
|
||||||
|
<import file="../utils_dev/properties.xml"/>
|
||||||
|
|
||||||
<!-- set path to include the necessary jar files for javac -->
|
<!-- set path to include the necessary jar files for javac -->
|
||||||
<path id="project.class.path">
|
<path id="project.class.path">
|
||||||
|
@ -106,6 +107,29 @@
|
||||||
<jar jarfile="${dist.dir}/${jar.name}.jar" basedir="${build.dir}"/>
|
<jar jarfile="${dist.dir}/${jar.name}.jar" basedir="${build.dir}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="plugin">
|
||||||
|
<buildPlugin workspaceDirectory=".."
|
||||||
|
projectName="base"
|
||||||
|
targetPlatformId="target.platform"
|
||||||
|
destination="../lib"
|
||||||
|
buildSourceJar="false"
|
||||||
|
clean="no"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="plugin-dist">
|
||||||
|
<buildPlugin workspaceDirectory=".."
|
||||||
|
projectName="base"
|
||||||
|
targetPlatformId="target.platform"
|
||||||
|
destination="${env.ADEMPIERE_ROOT}/Adempiere/osgi"
|
||||||
|
buildSourceJar="false"
|
||||||
|
clean="no"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="dist-standalone" depends="plugin">
|
||||||
|
<copy file="${dist.dir}/${bundle.name}_${bundle.version}.jar"
|
||||||
|
todir="${equinox.target}/dist/standalone/plugins"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<path id="class.path.test">
|
<path id="class.path.test">
|
||||||
<pathelement path="${build.dir}"/>
|
<pathelement path="${build.dir}"/>
|
||||||
<pathelement path="${classpath}"/>
|
<pathelement path="${classpath}"/>
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
<extension-point id="org.adempiere.base.IColumnCallout" name="Callout" schema="schema/org.adempiere.base.Callout.exsd"/>
|
<extension-point id="org.adempiere.base.IColumnCallout" name="Callout" schema="schema/org.adempiere.base.Callout.exsd"/>
|
||||||
<extension-point id="org.adempiere.base.IDictionaryService" name="DictionaryService" schema="schema/org.adempiere.base.IDictionaryService.exsd"/>
|
<extension-point id="org.adempiere.base.IDictionaryService" name="DictionaryService" schema="schema/org.adempiere.base.IDictionaryService.exsd"/>
|
||||||
<extension-point id="org.compiere.apps.form.FormPanel" name="FormPanel" schema="schema/org.compiere.apps.form.FormPanel.exsd"/>
|
<extension-point id="org.compiere.apps.form.FormPanel" name="FormPanel" schema="schema/org.compiere.apps.form.FormPanel.exsd"/>
|
||||||
|
<extension-point id="org.adempiere.as.IApplicationServer" name="ApplicationServer" schema="schema/org.adempiere.as.IApplicationServer.exsd"/>
|
||||||
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!-- Schema file written by PDE -->
|
||||||
|
<schema targetNamespace="org.adempiere.base" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<annotation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.schema plugin="org.adempiere.base" id="org.adempiere.as.IApplicationServer" name="ApplicationServer"/>
|
||||||
|
</appinfo>
|
||||||
|
<documentation>
|
||||||
|
[Enter description of this extension point.]
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<element name="extension">
|
||||||
|
<annotation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.element />
|
||||||
|
</appinfo>
|
||||||
|
</annotation>
|
||||||
|
<complexType>
|
||||||
|
<choice>
|
||||||
|
<element ref="client"/>
|
||||||
|
</choice>
|
||||||
|
<attribute name="point" type="string" use="required">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="id" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="name" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
|
||||||
|
</documentation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.attribute translatable="true"/>
|
||||||
|
</appinfo>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
</complexType>
|
||||||
|
</element>
|
||||||
|
|
||||||
|
<element name="client">
|
||||||
|
<complexType>
|
||||||
|
<attribute name="class" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
|
||||||
|
</documentation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.attribute kind="java" basedOn=":org.adempiere.as.IApplicationServer"/>
|
||||||
|
</appinfo>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
</complexType>
|
||||||
|
</element>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.section type="since"/>
|
||||||
|
</appinfo>
|
||||||
|
<documentation>
|
||||||
|
[Enter the first release in which this extension point appears.]
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.section type="examples"/>
|
||||||
|
</appinfo>
|
||||||
|
<documentation>
|
||||||
|
[Enter extension point usage example here.]
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.section type="apiinfo"/>
|
||||||
|
</appinfo>
|
||||||
|
<documentation>
|
||||||
|
[Enter API information here.]
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<appinfo>
|
||||||
|
<meta.section type="implementation"/>
|
||||||
|
</appinfo>
|
||||||
|
<documentation>
|
||||||
|
[Enter information about supplied implementation of this extension point.]
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
|
||||||
|
</schema>
|
|
@ -14,6 +14,8 @@ package org.adempiere.as;
|
||||||
|
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
import org.adempiere.base.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Low Heng Sin
|
* @author Low Heng Sin
|
||||||
|
@ -28,24 +30,10 @@ public class ASFactory {
|
||||||
JBOSS, GLASS_FISH
|
JBOSS, GLASS_FISH
|
||||||
};
|
};
|
||||||
|
|
||||||
private final static String[] AS_Classes = new String[] {
|
|
||||||
"org.adempiere.as.jboss.JBoss",
|
|
||||||
"org.adempiere.as.glassfish.GlassFish"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static IApplicationServer applicationServer;
|
private static IApplicationServer applicationServer;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
//detect the installed application server
|
applicationServer = Service.locate(IApplicationServer.class);
|
||||||
for(String s : AS_Classes) {
|
|
||||||
try {
|
|
||||||
Class<?> c = Class.forName(s);
|
|
||||||
IApplicationServer server = (IApplicationServer) c.newInstance();
|
|
||||||
applicationServer = server;
|
|
||||||
break;
|
|
||||||
} catch (Throwable t) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (applicationServer == null) {
|
if (applicationServer == null) {
|
||||||
applicationServer = new IApplicationServer() {
|
applicationServer = new IApplicationServer() {
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,14 @@ package org.adempiere.as;
|
||||||
|
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
import org.adempiere.base.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Low Heng Sin
|
* @author Low Heng Sin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface IApplicationServer {
|
public interface IApplicationServer extends IService {
|
||||||
/**
|
/**
|
||||||
* @param AppsHost
|
* @param AppsHost
|
||||||
* @param AppsPort
|
* @param AppsPort
|
||||||
|
|
|
@ -18,8 +18,6 @@ package org.adempiere.base;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.adempiere.base.equinox.EquinoxServiceLocator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a very simple factory for service locators
|
* This is a very simple factory for service locators
|
||||||
*
|
*
|
||||||
|
@ -28,21 +26,37 @@ import org.adempiere.base.equinox.EquinoxServiceLocator;
|
||||||
*/
|
*/
|
||||||
public class Service {
|
public class Service {
|
||||||
|
|
||||||
|
private static final String LOCATOR_CLASS = "ServiceLocator";
|
||||||
|
private static final String DEFAULT_LOCATOR_CLASS = "org.adempiere.base.equinox.EquinoxServiceLocator";
|
||||||
|
|
||||||
private static IServiceLocator theLocator;
|
private static IServiceLocator theLocator;
|
||||||
|
|
||||||
public static IServiceLocator locator() {
|
public static IServiceLocator locator() {
|
||||||
if (theLocator == null) {
|
if (theLocator == null) {
|
||||||
synchronized (Service.class) {
|
synchronized (Service.class) {
|
||||||
if (theLocator == null) {
|
if (theLocator == null) {
|
||||||
theLocator = new EquinoxServiceLocator();
|
theLocator = createServiceLocator();
|
||||||
System.out
|
|
||||||
.println("Started service locator: " + theLocator);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return theLocator;
|
return theLocator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IServiceLocator createServiceLocator() {
|
||||||
|
String className = System.getProperty(LOCATOR_CLASS);
|
||||||
|
if (className==null)
|
||||||
|
className = DEFAULT_LOCATOR_CLASS;
|
||||||
|
try {
|
||||||
|
Class<?> clazz = Class.forName(className);
|
||||||
|
IServiceLocator locator = (IServiceLocator) clazz.newInstance();
|
||||||
|
System.out.println("Started service locator: " + locator);
|
||||||
|
return locator;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static <T extends IService> T locate(Class<T> type) {
|
public static <T extends IService> T locate(Class<T> type) {
|
||||||
return locator().locate(type);
|
return locator().locate(type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.compiere.db;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
|
import java.rmi.RMISecurityManager;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DatabaseMetaData;
|
import java.sql.DatabaseMetaData;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
@ -1630,7 +1631,6 @@ public class CConnection implements Serializable, Cloneable
|
||||||
|
|
||||||
private Object lookup(String jndiName) throws NamingException {
|
private Object lookup(String jndiName) throws NamingException {
|
||||||
InitialContext ctx = getInitialContext(Ini.isClient());
|
InitialContext ctx = getInitialContext(Ini.isClient());
|
||||||
|
|
||||||
if (useComponentNamespace)
|
if (useComponentNamespace)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue