openbus-cvs-commits Mailing List for Openbus (Page 4)
Status: Alpha
Brought to you by:
esancho
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(166) |
May
(99) |
Jun
(135) |
Jul
(65) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Esteban S. <es...@us...> - 2005-06-28 03:07:33
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15780 Modified Files: .classpath Log Message: Updating .classpath file to reflect new dependency (JMock) Index: .classpath =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/.classpath,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** .classpath 24 Jun 2005 15:33:54 -0000 1.6 --- .classpath 28 Jun 2005 03:07:23 -0000 1.7 *************** *** 12,15 **** --- 12,17 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jmock/jars/jmock-1.0.1.jar"> + </classpathentry> <classpathentry kind="var" path="MAVEN_REPO/hivemind/jars/hivemind-1.0.jar"> </classpathentry> |
|
From: Esteban S. <es...@us...> - 2005-06-28 03:03:09
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959/src/java/org/openbus/jbi/install Modified Files: JBIInstaller.java Removed Files: ComponentInstaller.java InstallationKeys.java SharedLibraryInstaller.java Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. --- ComponentInstaller.java DELETED --- --- SharedLibraryInstaller.java DELETED --- Index: JBIInstaller.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/install/JBIInstaller.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JBIInstaller.java 9 Jun 2005 00:42:56 -0000 1.1 --- JBIInstaller.java 28 Jun 2005 03:02:29 -0000 1.2 *************** *** 16,19 **** --- 16,21 ---- package org.openbus.jbi.install; + import javax.management.ObjectName; + /** * *************** *** 21,24 **** * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public interface JBIInstaller ! extends ComponentInstaller, SharedLibraryInstaller {} \ No newline at end of file --- 23,40 ---- * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public interface JBIInstaller { ! public ObjectName loadInstaller(String componentName) ! throws InstallationException; ! ! public ObjectName loadNewInstaller(String installZipURL) ! throws InstallationException; ! ! public void unloadInstaller(String componentName, boolean isToBeDeleted) ! throws InstallationException; ! ! public String installSharedLibrary(String slZipURL) ! throws InstallationException; ! ! public void uninstallSharedLibrary(String slName) ! throws InstallationException; ! } \ No newline at end of file --- InstallationKeys.java DELETED --- |
|
From: Esteban S. <es...@us...> - 2005-06-28 03:02:43
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959 Modified Files: project.xml Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. Index: project.xml =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/project.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** project.xml 27 Jun 2005 03:11:56 -0000 1.11 --- project.xml 28 Jun 2005 03:02:31 -0000 1.12 *************** *** 18,67 **** --> <project> ! <extend>${basedir}/../project.xml</extend> ! <!-- the version of maven's project object model --> ! <pomVersion>3</pomVersion> ! <!-- a unique name for this project --> ! <id>jbi</id> ! <!-- a short but descriptive name for the project --> ! <name>Openbus JBI</name> ! <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-SNAPSHOT --> ! <currentVersion>0.1.0</currentVersion> ! <!-- the year the project started --> ! <inceptionYear>2005</inceptionYear> ! <package>org.openbus.jbi</package> ! <logo>http://www.openbus.org/jbi/images/jbi_logo.jpg</logo> ! <description>An open source implementation of the JSR 208: Java Business Integration (JBI)</description> ! <!-- a short description of what the project does --> ! <shortDescription>An open source JBI implementation</shortDescription> ! <!-- the project home page --> ! <url>http://www.openbus.org/jbi/</url> ! <issueTrackingUrl/> ! <siteAddress>shell.sourceforge.net</siteAddress> ! <siteDirectory>/home/groups/o/op/openbus/htdocs/jbi</siteDirectory> ! <distributionDirectory> ! /home/groups/o/op/openbus/htdocs/jbi/builds/</distributionDirectory> ! <!-- the version control repository and http url for online access the connection element has the form: scm:<system>:<system specific connection string> --> ! <repository/> ! <!-- any mailing lists for the project --> ! <mailingLists/> ! <!-- who the developers are for the project --> ! <developers> ! <developer> ! <name>Diego Erdody</name> ! <id>diego</id> ! <email>di...@op...</email> ! </developer> ! <developer> ! <name>Esteban Sancho</name> ! <id>esteban</id> ! <email>es...@op...</email> ! </developer> ! </developers> ! <!-- jar files the project is dependent on --> ! <dependencies> <dependency> <groupId>jmock</groupId> --- 18,73 ---- --> <project> ! <extend>${basedir}/../project.xml</extend> ! <!-- the version of maven's project object model --> ! <pomVersion>3</pomVersion> ! <!-- a unique name for this project --> ! <artifactId>jbi</artifactId> ! <groupId>openbus</groupId> ! <id>jbi</id> ! <!-- a short but descriptive name for the project --> ! <name>Openbus JBI</name> ! <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-SNAPSHOT --> ! <currentVersion>0.1.0</currentVersion> ! <!-- the year the project started --> ! <inceptionYear>2005</inceptionYear> ! <package>org.openbus.jbi</package> ! <logo>http://www.openbus.org/jbi/images/jbi_logo.jpg</logo> ! <description>An open source implementation of the JSR 208: Java Business Integration (JBI)</description> ! <!-- a short description of what the project does --> ! <shortDescription>An open source JBI implementation</shortDescription> ! <!-- the project home page --> ! <url>http://www.openbus.org/jbi/</url> ! <siteAddress>shell.sourceforge.net</siteAddress> ! <siteDirectory>/home/groups/o/op/openbus/htdocs/jbi</siteDirectory> ! <distributionDirectory>/home/groups/o/op/openbus/htdocs/jbi/builds/</distributionDirectory> ! <!-- the version control repository and http url for online access the connection element has the form: scm:<system>:<system specific connection string> --> ! <repository /> ! <!-- any mailing lists for the project --> ! <!-- who the developers are for the project --> ! <developers> ! <developer> ! <name>Diego Erdody</name> ! <id>diego</id> ! <email>di...@op...</email> ! <timezone>-3</timezone> ! </developer> ! <developer> ! <name>Esteban Sancho</name> ! <id>esteban</id> ! <email>es...@op...</email> ! <timezone>-3</timezone> ! </developer> ! </developers> ! <contributors> ! <contributor> ! <name>Javier Storni</name> ! </contributor> ! </contributors> ! <!-- jar files the project is dependent on --> ! <dependencies> <dependency> <groupId>jmock</groupId> *************** *** 79,271 **** <version>1.0</version> </dependency> ! <dependency> ! <groupId>openbus</groupId> ! <artifactId>commons</artifactId> ! <version>0.1.0</version> ! <properties> ! <eclipse.dependency>true</eclipse.dependency> ! </properties> ! </dependency> ! <dependency> ! <groupId>commons-beanutils</groupId> ! <artifactId>commons-beanutils</artifactId> ! <version>1.7.0</version> ! </dependency> ! <dependency> ! <groupId>commons-io</groupId> ! <artifactId>commons-io</artifactId> ! <version>1.0</version> ! </dependency> ! <dependency> ! <groupId>commons-transaction</groupId> ! <artifactId>commons-transaction</artifactId> ! <version>1.1</version> ! </dependency> ! <dependency> ! <groupId>commons-codec</groupId> ! <artifactId>commons-codec</artifactId> ! <version>1.2</version> ! </dependency> ! <dependency> ! <groupId>commons-lang</groupId> ! <artifactId>commons-lang</artifactId> ! <version>2.0</version> ! </dependency> ! <dependency> ! <groupId>commons-collections</groupId> ! <artifactId>commons-collections</artifactId> ! <version>3.1</version> ! </dependency> ! <dependency> ! <groupId>commons-digester</groupId> ! <artifactId>commons-digester</artifactId> ! <version>1.6</version> ! </dependency> ! <dependency> ! <groupId>commons-logging</groupId> ! <artifactId>commons-logging</artifactId> ! <version>1.0.4</version> ! </dependency> ! <dependency> ! <groupId>commons-cli</groupId> ! <artifactId>commons-cli</artifactId> ! <version>1.0</version> ! </dependency> ! <dependency> ! <groupId>commons-configuration</groupId> ! <artifactId>commons-configuration</artifactId> ! <version>1.1</version> ! </dependency> ! <dependency> ! <groupId>xalan</groupId> ! <artifactId>xalan</artifactId> ! <version>2.6.0</version> ! </dependency> ! <dependency> ! <groupId>xerces</groupId> ! <artifactId>xercesImpl</artifactId> ! <version>2.6.2</version> ! </dependency> ! <dependency> ! <groupId>xerces</groupId> ! <artifactId>xmlParserAPIs</artifactId> ! <version>2.6.2</version> ! </dependency> ! <dependency> ! <groupId>jta</groupId> ! <artifactId>jta</artifactId> ! <version>1.0.1</version> ! </dependency> ! <dependency> ! <groupId>jta</groupId> ! <artifactId>jts</artifactId> ! <version>1.0</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm</artifactId> ! <version>2.0.10</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm-jrmp-stubs</artifactId> ! <version>2.0.10</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm-carol</artifactId> ! <version>2.0.0</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm-howl</artifactId> ! <version>0.1.8</version> ! </dependency> ! <dependency> ! <groupId>jca</groupId> ! <artifactId>jca</artifactId> ! <version>1.5</version> ! </dependency> ! <dependency> ! <groupId>jaf</groupId> ! <artifactId>activation</artifactId> ! <version>1.0.2</version> ! </dependency> ! <dependency> ! <groupId>jms</groupId> ! <artifactId>jms</artifactId> ! <version>1.1.0</version> ! </dependency> ! <dependency> ! <groupId>mx4j</groupId> ! <artifactId>mx4j</artifactId> ! <version>2.1.1</version> ! </dependency> ! <dependency> ! <groupId>mx4j</groupId> ! <artifactId>mx4j-tools</artifactId> ! <version>2.1.1</version> ! </dependency> ! <dependency> ! <groupId>joram</groupId> ! <artifactId>joram-client</artifactId> ! <version>4.2.0</version> ! </dependency> ! <dependency> ! <groupId>joram</groupId> ! <artifactId>joram-mom</artifactId> ! <version>4.2.0</version> ! </dependency> ! <dependency> ! <groupId>joram</groupId> ! <artifactId>joram-shared</artifactId> ! <version>4.2.0</version> ! </dependency> ! <dependency> ! <groupId>monolog</groupId> ! <artifactId>monolog</artifactId> ! <version>1.8</version> ! </dependency> ! <dependency> ! <groupId>log4j</groupId> ! <artifactId>log4j</artifactId> ! <version>1.2.8</version> ! </dependency> ! <dependency> ! <groupId>wsdl4j</groupId> ! <artifactId>wsdl4j</artifactId> ! <version>1.4</version> ! </dependency> ! <dependency> ! <groupId>jax-qname</groupId> ! <artifactId>jax-qname</artifactId> ! <version>1.0.3</version> ! </dependency> ! </dependencies> ! <!-- build information for the project --> ! <build> ! <nagEmailAddress> ! ope...@li...</nagEmailAddress> ! <sourceDirectory>src/java</sourceDirectory> ! <unitTestSourceDirectory>src/test</unitTestSourceDirectory> ! <unitTest> ! <includes> ! <include>**/*Test.java</include> ! </includes> ! </unitTest> ! <resources> ! <resource> ! <directory>src/test</directory> ! <includes> ! <include>**/*.xml</include> ! </includes> ! </resource> ! <resource> ! <directory>src/conf</directory> ! <includes> ! <include>*.properties</include> ! </includes> ! </resource> ! </resources> ! </build> ! </project> \ No newline at end of file --- 85,279 ---- <version>1.0</version> </dependency> ! <dependency> ! <groupId>openbus</groupId> ! <artifactId>commons</artifactId> ! <version>0.1.0</version> ! <properties> ! <eclipse.dependency>true</eclipse.dependency> ! </properties> ! </dependency> ! <dependency> ! <groupId>commons-beanutils</groupId> ! <artifactId>commons-beanutils</artifactId> ! <version>1.7.0</version> ! </dependency> ! <dependency> ! <groupId>commons-io</groupId> ! <artifactId>commons-io</artifactId> ! <version>1.0</version> ! </dependency> ! <dependency> ! <groupId>commons-transaction</groupId> ! <artifactId>commons-transaction</artifactId> ! <version>1.1</version> ! </dependency> ! <dependency> ! <groupId>commons-codec</groupId> ! <artifactId>commons-codec</artifactId> ! <version>1.2</version> ! </dependency> ! <dependency> ! <groupId>commons-lang</groupId> ! <artifactId>commons-lang</artifactId> ! <version>2.0</version> ! </dependency> ! <dependency> ! <groupId>commons-collections</groupId> ! <artifactId>commons-collections</artifactId> ! <version>3.1</version> ! </dependency> ! <dependency> ! <groupId>commons-digester</groupId> ! <artifactId>commons-digester</artifactId> ! <version>1.6</version> ! </dependency> ! <dependency> ! <groupId>commons-logging</groupId> ! <artifactId>commons-logging</artifactId> ! <version>1.0.4</version> ! </dependency> ! <dependency> ! <groupId>commons-cli</groupId> ! <artifactId>commons-cli</artifactId> ! <version>1.0</version> ! </dependency> ! <dependency> ! <groupId>commons-configuration</groupId> ! <artifactId>commons-configuration</artifactId> ! <version>1.1</version> ! </dependency> ! <dependency> ! <groupId>xalan</groupId> ! <artifactId>xalan</artifactId> ! <version>2.6.0</version> ! </dependency> ! <dependency> ! <groupId>xerces</groupId> ! <artifactId>xercesImpl</artifactId> ! <version>2.6.2</version> ! </dependency> ! <dependency> ! <groupId>xerces</groupId> ! <artifactId>xmlParserAPIs</artifactId> ! <version>2.6.2</version> ! </dependency> ! <dependency> ! <groupId>jta</groupId> ! <artifactId>jta</artifactId> ! <version>1.0.1</version> ! </dependency> ! <dependency> ! <groupId>jta</groupId> ! <artifactId>jts</artifactId> ! <version>1.0</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm</artifactId> ! <version>2.0.10</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm-jrmp-stubs</artifactId> ! <version>2.0.10</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm-carol</artifactId> ! <version>2.0.0</version> ! </dependency> ! <dependency> ! <groupId>jotm</groupId> ! <artifactId>jotm-howl</artifactId> ! <version>0.1.8</version> ! </dependency> ! <dependency> ! <groupId>jca</groupId> ! <artifactId>jca</artifactId> ! <version>1.5</version> ! </dependency> ! <dependency> ! <groupId>jaf</groupId> ! <artifactId>activation</artifactId> ! <version>1.0.2</version> ! </dependency> ! <dependency> ! <groupId>jms</groupId> ! <artifactId>jms</artifactId> ! <version>1.1.0</version> ! </dependency> ! <dependency> ! <groupId>mx4j</groupId> ! <artifactId>mx4j</artifactId> ! <version>2.1.1</version> ! </dependency> ! <dependency> ! <groupId>mx4j</groupId> ! <artifactId>mx4j-tools</artifactId> ! <version>2.1.1</version> ! </dependency> ! <dependency> ! <groupId>joram</groupId> ! <artifactId>joram-client</artifactId> ! <version>4.2.0</version> ! </dependency> ! <dependency> ! <groupId>joram</groupId> ! <artifactId>joram-mom</artifactId> ! <version>4.2.0</version> ! </dependency> ! <dependency> ! <groupId>joram</groupId> ! <artifactId>joram-shared</artifactId> ! <version>4.2.0</version> ! </dependency> ! <dependency> ! <groupId>monolog</groupId> ! <artifactId>monolog</artifactId> ! <version>1.8</version> ! </dependency> ! <dependency> ! <groupId>log4j</groupId> ! <artifactId>log4j</artifactId> ! <version>1.2.8</version> ! </dependency> ! <dependency> ! <groupId>wsdl4j</groupId> ! <artifactId>wsdl4j</artifactId> ! <version>1.4</version> ! </dependency> ! <dependency> ! <groupId>jax-qname</groupId> ! <artifactId>jax-qname</artifactId> ! <version>1.0.3</version> ! </dependency> ! </dependencies> ! <!-- build information for the project --> ! <build> ! <nagEmailAddress>ope...@li...</nagEmailAddress> ! <sourceDirectory>src/java</sourceDirectory> ! <unitTestSourceDirectory>src/test</unitTestSourceDirectory> ! <unitTest> ! <includes> ! <include>**/*Test.java</include> ! </includes> ! </unitTest> ! <resources> ! <resource> ! <directory>src/test</directory> ! <includes> ! <include>**/*.xml</include> ! </includes> ! <filtering>false</filtering> ! </resource> ! <resource> ! <directory>src/conf</directory> ! <includes> ! <include>*.properties</include> ! </includes> ! <filtering>false</filtering> ! </resource> ! </resources> ! </build> ! </project> ! |
|
From: Esteban S. <es...@us...> - 2005-06-28 03:02:41
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959/src/java/org/openbus/jbi/framework/impl Modified Files: FileSystemRepositoryImpl.java HashmapJBIRegistryImpl.java Removed Files: RepositoryConfig.java Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. --- RepositoryConfig.java DELETED --- Index: HashmapJBIRegistryImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/impl/HashmapJBIRegistryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HashmapJBIRegistryImpl.java 9 Jun 2005 00:42:57 -0000 1.1 --- HashmapJBIRegistryImpl.java 28 Jun 2005 03:02:32 -0000 1.2 *************** *** 24,36 **** import java.util.Iterator; - import javax.transaction.xa.XAResource; - import org.apache.commons.collections.collection.UnmodifiableCollection; import org.apache.commons.lang.SerializationUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.apache.commons.transaction.memory.OptimisticMapWrapper; - import org.apache.commons.transaction.memory.TransactionalMapWrapper; - import org.apache.commons.transaction.memory.jca.MapXAResource; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.FrameworkException; --- 24,31 ---- *************** *** 49,63 **** .getLog(HashmapJBIRegistryImpl.class); - // Map wrappers providing transactionality - private transient TransactionalMapWrapper sharedLibraries = null; - private transient TransactionalMapWrapper components = null; - // Backend maps to be serialized ! private HashMap sharedLibrariesBackend; ! private HashMap componentsBackend; ! ! // XAResources ! private transient XAResource librariesResource; ! private transient XAResource componentsResource; // To allow version changes on this class --- 44,50 ---- .getLog(HashmapJBIRegistryImpl.class); // Backend maps to be serialized ! private HashMap sharedLibraries; ! private HashMap components; // To allow version changes on this class *************** *** 65,79 **** public HashmapJBIRegistryImpl() { ! sharedLibrariesBackend = new HashMap(); ! componentsBackend = new HashMap(); ! initializeMaps(); ! } ! ! private void initializeMaps() { ! // @todo change logger ! sharedLibraries = new OptimisticMapWrapper(sharedLibrariesBackend); ! components = new OptimisticMapWrapper(componentsBackend); ! librariesResource = new MapXAResource(sharedLibraries); ! componentsResource = new MapXAResource(components); } --- 52,57 ---- public HashmapJBIRegistryImpl() { ! sharedLibraries = new HashMap(); ! components = new HashMap(); } *************** *** 85,89 **** ClassNotFoundException { in.defaultReadObject(); - initializeMaps(); } --- 63,66 ---- *************** *** 283,292 **** } - public XAResource[] getXAResources() { - XAResource[] resources = new XAResource[2]; - resources[0] = librariesResource; - resources[1] = componentsResource; - return resources; - } - } \ No newline at end of file --- 260,262 ---- Index: FileSystemRepositoryImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/impl/FileSystemRepositoryImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileSystemRepositoryImpl.java 16 Jun 2005 03:35:38 -0000 1.2 --- FileSystemRepositoryImpl.java 28 Jun 2005 03:02:32 -0000 1.3 *************** *** 17,31 **** import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; ! import javax.transaction.xa.XAResource; ! import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ! import org.openbus.commons.transaction.TransactionalException; ! import org.openbus.commons.transaction.impl.TransactionalFileSystemImpl; ! import org.openbus.commons.transaction.impl.ZipUtils; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.FrameworkException; --- 17,30 ---- import java.io.File; + import java.io.FileInputStream; + import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; ! import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ! import org.openbus.commons.util.ZipUtils; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.FrameworkException; *************** *** 44,55 **** private static final String SHARED_LIBRARIES_PATH = "shared"; private static final String TEMP_DIR_PATH = "temp"; ! private static final String REGISTRY_FILE_NAME = "jbi-registry.bin"; // internal data private static Log log = LogFactory.getLog(FileSystemRepositoryImpl.class); private File installRoot; - private TransactionalFileSystemImpl repoFS; - private TransactionalFileSystemImpl libFS; - private TransactionalFileSystemImpl compFS; public FileSystemRepositoryImpl(String installRoot_) --- 43,51 ---- private static final String SHARED_LIBRARIES_PATH = "shared"; private static final String TEMP_DIR_PATH = "temp"; ! private static final String REGISTRY_FILE_NAME = "jbi-registry.dat"; // internal data private static Log log = LogFactory.getLog(FileSystemRepositoryImpl.class); private File installRoot; public FileSystemRepositoryImpl(String installRoot_) *************** *** 64,127 **** throw new FrameworkException("Install root doesn't exist"); } - try { - // initialize repo filesystem - String repoStoreDir = getRepositoryPath(); - String repoWorkingDir = installRoot_ + File.separator - + TEMP_DIR_PATH + File.separator + REPOSITORY_PATH; - //create dirs if they don't exist - new File(repoStoreDir).mkdirs(); - new File(repoWorkingDir).mkdirs(); - // create transactional file system - repoFS = new TransactionalFileSystemImpl(repoStoreDir, - repoWorkingDir); - - // initialize libraries filesystem - String libStoreDir = getLibrariesPath(); - String libWorkingDir = installRoot_ + File.separator - + TEMP_DIR_PATH + File.separator + SHARED_LIBRARIES_PATH; - //create dirs if they don't exist - new File(libStoreDir).mkdirs(); - new File(libWorkingDir).mkdirs(); - // create transactional file system - libFS = new TransactionalFileSystemImpl(libStoreDir, libWorkingDir); - - // initialize components filesystem - String compStoreDir = getComponentsPath(); - String compWorkingDir = installRoot_ + File.separator - + TEMP_DIR_PATH + File.separator + COMPONENTS_PATH; - //create dirs if they don't exist - new File(compStoreDir).mkdirs(); - new File(compWorkingDir).mkdirs(); - // create transactional file system - compFS = new TransactionalFileSystemImpl(compStoreDir, - compWorkingDir); - } catch (TransactionalException e) { - // @todo i18n - throw new FrameworkException("Error in constructor", e); - } - } - - public void init() throws FrameworkException { - try { - // @todo more elegant solution - repoFS.start(); - libFS.start(); - compFS.start(); - } catch (TransactionalException e) { - // @todo i18n - throw new FrameworkException("Error initializing repository", e); - } - } - - public void shutdown() throws FrameworkException { - try { - // @todo more elegant solution - repoFS.stop(); - libFS.stop(); - compFS.stop(); - } catch (TransactionalException e) { - // @todo i18n - throw new FrameworkException("Error shutting repository down", e); - } } --- 60,63 ---- *************** *** 130,133 **** --- 66,73 ---- } + public String getRegistryPath() { + return getRepositoryPath() + File.separator + REGISTRY_FILE_NAME; + } + public String getLibrariesPath() { return installRoot.getAbsolutePath() + File.separator *************** *** 142,147 **** throws FrameworkException { try { ! ObjectOutputStream os = new ObjectOutputStream(repoFS ! .writeFile(REGISTRY_FILE_NAME)); os.writeObject(registry_); os.close(); --- 82,91 ---- throws FrameworkException { try { ! File regFile = new File(getRegistryPath()); ! if (!regFile.getParentFile().exists()) { ! FileUtils.forceMkdir(regFile.getParentFile()); ! } ! ObjectOutputStream os = new ObjectOutputStream( ! new FileOutputStream(regFile)); os.writeObject(registry_); os.close(); *************** *** 149,157 **** // @todo i18n throw new FrameworkException("Couldn't store the registry", ioe); - } catch (TransactionalException te) { - // @todo i18n - throw new FrameworkException("Couldn't store the registry", te); } ! return getRepositoryPath() + File.separator + REGISTRY_FILE_NAME; } --- 93,98 ---- // @todo i18n throw new FrameworkException("Couldn't store the registry", ioe); } ! return getRegistryPath(); } *************** *** 162,167 **** registry = createNewRegistry(); } else { ! ObjectInputStream is = new ObjectInputStream(repoFS ! .readFile(REGISTRY_FILE_NAME)); registry = (JBIRegistry) is.readObject(); is.close(); --- 103,108 ---- registry = createNewRegistry(); } else { ! ObjectInputStream is = new ObjectInputStream( ! new FileInputStream(getRegistryPath())); registry = (JBIRegistry) is.readObject(); is.close(); *************** *** 173,179 **** // @todo i18n throw new FrameworkException("Couldn't load the registry", cnfe); - } catch (TransactionalException te) { - // @todo i18n - throw new FrameworkException("Couldn't store the registry", te); } return registry; --- 114,117 ---- *************** *** 182,203 **** public void removeRegistry() throws FrameworkException { try { ! repoFS.deleteFile(REGISTRY_FILE_NAME); ! } catch (TransactionalException te) { // @todo i18n throw new FrameworkException("Couldn't remove registry file " ! + REGISTRY_FILE_NAME, te); } } public boolean isRegistryCreated() throws FrameworkException { ! boolean exists = false; ! try { ! exists = repoFS.fileExists(REGISTRY_FILE_NAME); ! } catch (TransactionalException e) { ! // @todo i18n ! throw new FrameworkException("Unable to check registry existence", ! e); ! } ! return exists; } --- 120,133 ---- public void removeRegistry() throws FrameworkException { try { ! FileUtils.forceDelete(new File(getRegistryPath())); ! } catch (IOException ioe) { // @todo i18n throw new FrameworkException("Couldn't remove registry file " ! + getRegistryPath(), ioe); } } public boolean isRegistryCreated() throws FrameworkException { ! return new File(getRegistryPath()).exists(); } *************** *** 219,238 **** throw new FrameworkException("Component is already installed"); } try { ! ZipUtils.inflate(component_.getUniqueName(), zipFile_, compFS); ! } catch (TransactionalException e) { // @todo i18n ! throw new FrameworkException("Unable to store component", e); } ! return getComponentsPath() + File.separator ! + component_.getUniqueName(); } public void removeComponent(Component component_) throws FrameworkException { try { ! compFS.deleteDirectory(component_.getUniqueName()); ! } catch (TransactionalException e) { // @todo i18n ! throw new FrameworkException("Unable to remove component", e); } } --- 149,171 ---- throw new FrameworkException("Component is already installed"); } + File componentDir = new File(getComponentsPath(), component_ + .getUniqueName()); try { ! ZipUtils.inflate(zipFile_, componentDir); ! } catch (IOException ioe) { // @todo i18n ! throw new FrameworkException("Unable to store component", ioe); } ! return componentDir.getAbsolutePath(); } public void removeComponent(Component component_) throws FrameworkException { try { ! File componentDir = new File(getComponentsPath(), component_ ! .getUniqueName()); ! FileUtils.deleteDirectory(componentDir); ! } catch (IOException ioe) { // @todo i18n ! throw new FrameworkException("Unable to remove component", ioe); } } *************** *** 240,253 **** public boolean isComponentStored(Component component_) throws FrameworkException { ! boolean exists = false; ! try { ! exists = compFS.fileExists(component_.getUniqueName()); ! } catch (TransactionalException e) { ! // @todo i18n ! throw new FrameworkException( ! "Unable to check component existence: " ! + component_.getUniqueName(), e); ! } ! return exists; } --- 173,179 ---- public boolean isComponentStored(Component component_) throws FrameworkException { ! File componentDir = new File(getComponentsPath(), component_ ! .getUniqueName()); ! return componentDir.exists(); } *************** *** 260,271 **** } String libraryPath = getLibraryPath(library_); try { ! ZipUtils.inflate(libraryPath, zipFile_, libFS); ! } catch (TransactionalException e) { // @todo i18n throw new FrameworkException("Unable to store library " ! + library_.getUniqueName(), e); } ! return getLibrariesPath() + File.separator + libraryPath; } --- 186,199 ---- } String libraryPath = getLibraryPath(library_); + File libraryDir = new File(getLibrariesPath(), getLibraryPath(library_)); try { ! FileUtils.forceMkdir(libraryDir); ! ZipUtils.inflate(zipFile_, libraryDir); ! } catch (IOException ioe) { // @todo i18n throw new FrameworkException("Unable to store library " ! + library_.getUniqueName(), ioe); } ! return libraryDir.getAbsolutePath(); } *************** *** 273,280 **** throws FrameworkException { try { ! compFS.deleteDirectory(getLibraryPath(library_)); ! } catch (TransactionalException e) { // @todo i18n ! throw new FrameworkException("Unable to remove component", e); } } --- 201,213 ---- throws FrameworkException { try { ! File libraryDir = new File(getLibrariesPath(), getLibraryPath(library_)); ! File parentDir = libraryDir.getParentFile(); ! FileUtils.deleteDirectory(libraryDir); ! if (parentDir.list().length <= 0) { ! FileUtils.deleteDirectory(parentDir); ! } ! } catch (IOException ioe) { // @todo i18n ! throw new FrameworkException("Unable to remove shared library", ioe); } } *************** *** 282,297 **** public boolean isSharedLibraryStored(SharedLibrary library_) throws FrameworkException { ! boolean exists = false; ! try { ! exists = compFS.fileExists(getLibraryPath(library_)); ! } catch (TransactionalException e) { ! // @todo i18n ! throw new FrameworkException("Unable to check library existence: " ! + library_.getUniqueName(), e); ! } ! return exists; } ! protected String getLibraryPath(SharedLibrary library_) { String version = library_.getVersion(); if (version == null) { --- 215,224 ---- public boolean isSharedLibraryStored(SharedLibrary library_) throws FrameworkException { ! File libraryDir = new File(getLibrariesPath(), getLibraryPath(library_)); ! ! return libraryDir.exists(); } ! public String getLibraryPath(SharedLibrary library_) { String version = library_.getVersion(); if (version == null) { *************** *** 301,311 **** } - public XAResource[] getXAResources() throws TransactionalException { - XAResource[] resources = new XAResource[3]; - resources[0] = repoFS.getXAResource(); - resources[1] = libFS.getXAResource(); - resources[2] = compFS.getXAResource(); - return resources; - } - } \ No newline at end of file --- 228,230 ---- |
|
From: Esteban S. <es...@us...> - 2005-06-28 03:02:41
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959/src/test/org/openbus/jbi/loader Modified Files: CompositeClassLoaderTest.java Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. Index: CompositeClassLoaderTest.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/loader/CompositeClassLoaderTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompositeClassLoaderTest.java 24 Jun 2005 15:33:56 -0000 1.1 --- CompositeClassLoaderTest.java 28 Jun 2005 03:02:32 -0000 1.2 *************** *** 13,17 **** * See the License for the specific language governing permissions and * limitations under the License. ! */ package org.openbus.jbi.loader; --- 13,17 ---- * See the License for the specific language governing permissions and * limitations under the License. ! */ package org.openbus.jbi.loader; *************** *** 23,27 **** * * ! * @author <a href="mailto:es...@op...">Esteban Sancho</a> */ public class CompositeClassLoaderTest extends TestCase { --- 23,27 ---- * * ! * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ public class CompositeClassLoaderTest extends TestCase { *************** *** 39,43 **** DelegateClassLoader cl2 = new DelegateClassLoader(path2, getClass() .getClassLoader(), false); ! CompositeClassLoader composite = new CompositeClassLoader(ClassLoader.getSystemClassLoader()); composite.addClassLoader(cl1); composite.addClassLoader(cl2); --- 39,43 ---- DelegateClassLoader cl2 = new DelegateClassLoader(path2, getClass() .getClassLoader(), false); ! CompositeClassLoader composite = new CompositeClassLoader(); composite.addClassLoader(cl1); composite.addClassLoader(cl2); *************** *** 50,52 **** } ! } --- 50,52 ---- } ! } \ No newline at end of file |
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/framework/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959/src/test/org/openbus/jbi/framework/impl Modified Files: HashmapJBIRegistryImplTest.java FileSystemRepositoryImplTest.java Added Files: shared-library.zip FrameworkTestCaseSupport.java Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. --- NEW FILE: shared-library.zip --- (This appears to be a binary file; contents omitted.) Index: FileSystemRepositoryImplTest.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/framework/impl/FileSystemRepositoryImplTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemRepositoryImplTest.java 16 Jun 2005 03:35:38 -0000 1.1 --- FileSystemRepositoryImplTest.java 28 Jun 2005 03:02:31 -0000 1.2 *************** *** 19,31 **** import java.net.URLDecoder; - import javax.transaction.TransactionManager; - - import junit.framework.TestCase; - import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.objectweb.jotm.Jotm; - import org.openbus.commons.transaction.TransactionUtils; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.JBIRegistry; --- 19,25 ---- *************** *** 37,41 **** * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public class FileSystemRepositoryImplTest extends TestCase { FileSystemRepositoryImpl repository; File installRoot; --- 31,35 ---- * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public class FileSystemRepositoryImplTest extends FrameworkTestCaseSupport { FileSystemRepositoryImpl repository; File installRoot; *************** *** 48,87 **** installRoot.mkdir(); repository = new FileSystemRepositoryImpl(installRoot.getAbsolutePath()); - repository.init(); } protected void tearDown() throws Exception { - repository.shutdown(); FileUtils.deleteDirectory(installRoot); } public void testStoreRemoveRegistry() { - Jotm jotm = null; try { - // init transaction manager - jotm = new Jotm(true, false); - TransactionManager tm = jotm.getTransactionManager(); - tm.setTransactionTimeout(10000); - - // enlist resource - tm.begin(); - TransactionUtils.enlistResources(tm.getTransaction(), repository); - JBIRegistry reg = repository.retrieveRegistry(); // add a library ! SharedLibrary lib1 = new SharedLibrary(); ! lib1.setUniqueName("Lib 1"); ! lib1.setVersion("4.2"); reg.addSharedLibrary(lib1); // add a component ! Component comp1 = new Component(); ! comp1.setUniqueName("Comp 1"); reg.addComponent(comp1); repository.storeRegistry(reg); - tm.commit(); - - // enlist resource - tm.begin(); - TransactionUtils.enlistResources(tm.getTransaction(), repository); // retrieve registry --- 42,62 ---- installRoot.mkdir(); repository = new FileSystemRepositoryImpl(installRoot.getAbsolutePath()); } protected void tearDown() throws Exception { FileUtils.deleteDirectory(installRoot); } public void testStoreRemoveRegistry() { try { JBIRegistry reg = repository.retrieveRegistry(); // add a library ! SharedLibrary lib1 = new SharedLibrary(getLibraryDescription( ! "Lib 1", "4.2")); reg.addSharedLibrary(lib1); // add a component ! Component comp1 = new Component(getComponentDescription("Comp 1")); reg.addComponent(comp1); repository.storeRegistry(reg); // retrieve registry *************** *** 92,100 **** .isComponentInstalled("Comp 1")); repository.removeRegistry(); - tm.commit(); - - // enlist resource - tm.begin(); - TransactionUtils.enlistResources(tm.getTransaction(), repository); // retrieve registry --- 67,70 ---- *************** *** 104,108 **** assertFalse("Should have dissapeared", reg .isComponentInstalled("Comp 1")); - tm.commit(); } catch (Exception e) { e.printStackTrace(); --- 74,77 ---- *************** *** 112,134 **** public void testStoreRemoveComponent() { - Jotm jotm = null; try { - // init transaction manager - jotm = new Jotm(true, false); - TransactionManager tm = jotm.getTransactionManager(); - tm.setTransactionTimeout(10000); - - // enlist resource - tm.begin(); - TransactionUtils.enlistResources(tm.getTransaction(), repository); - String zipName = URLDecoder.decode(getClass().getResource( "/org/openbus/jbi/framework/impl/component.zip").getFile(), "UTF-8"); log.debug("Zip name: " + zipName); ! Component comp1 = new Component(); ! comp1.setUniqueName("Comp 1"); ! File compRoot = new File(installRoot, "components" + File.separator ! + comp1.getUniqueName()); log.debug("Component Root: " + compRoot); File descriptor = new File(compRoot, "META-INF/jbi.xml"); --- 81,92 ---- public void testStoreRemoveComponent() { try { String zipName = URLDecoder.decode(getClass().getResource( "/org/openbus/jbi/framework/impl/component.zip").getFile(), "UTF-8"); log.debug("Zip name: " + zipName); ! Component comp1 = new Component(getComponentDescription("Comp 1")); ! File compRoot = new File(repository.getComponentsPath(), comp1 ! .getUniqueName()); log.debug("Component Root: " + compRoot); File descriptor = new File(compRoot, "META-INF/jbi.xml"); *************** *** 141,145 **** // store component repository.storeComponent(comp1, zipName); - tm.commit(); assertTrue("Should exist now", compRoot.exists()); --- 99,102 ---- *************** *** 147,160 **** assertTrue("Should exist now", fruta.exists()); - // enlist resource - tm.begin(); - TransactionUtils.enlistResources(tm.getTransaction(), repository); - repository.removeComponent(comp1); - assertTrue("Should still exist", compRoot.exists()); - assertTrue("Should still exist", descriptor.exists()); - assertTrue("Should still exist", fruta.exists()); - - tm.commit(); assertFalse("Shouldn't exist anymore", compRoot.exists()); assertFalse("Shouldn't exist anymore", descriptor.exists()); --- 104,108 ---- *************** *** 167,170 **** --- 115,150 ---- public void testStoreRemoveSharedLibrary() { + try { + String zipName = URLDecoder.decode(getClass().getResource( + "/org/openbus/jbi/framework/impl/shared-library.zip") + .getFile(), "UTF-8"); + log.debug("Zip name: " + zipName); + SharedLibrary lib = new SharedLibrary(getLibraryDescription( + "BPEL Lib", "4.7")); + File libRoot = new File(repository.getLibrariesPath(), "BPEL Lib" + + File.separator + "4.7"); + log.debug("Library Root: " + libRoot); + File descriptor = new File(libRoot, "META-INF/jbi.xml"); + File fruta = new File(libRoot, "libFolder/artifact.txt"); + + assertFalse("Shouldn't exist yet", libRoot.exists()); + assertFalse("Shouldn't exist yet", descriptor.exists()); + assertFalse("Shouldn't exist yet", fruta.exists()); + + // store component + repository.storeSharedLibrary(lib, zipName); + + assertTrue("Should exist now", libRoot.exists()); + assertTrue("Should exist now", descriptor.exists()); + assertTrue("Should exist now", fruta.exists()); + + repository.removeSharedLibrary(lib); + assertFalse("Shouldn't exist anymore", libRoot.exists()); + assertFalse("Shouldn't exist anymore", descriptor.exists()); + assertFalse("Shouldn't exist anymore", fruta.exists()); + } catch (Exception e) { + e.printStackTrace(); + assertFalse("Exception caught ->" + e.getMessage(), true); + } } --- NEW FILE: FrameworkTestCaseSupport.java --- /* * Copyright 2001-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. */ package org.openbus.jbi.framework.impl; import org.openbus.jbi.descriptor.ComponentDesc; import org.openbus.jbi.descriptor.IdentificationDesc; import org.openbus.jbi.descriptor.SharedLibraryDesc; import junit.framework.TestCase; /** * * * @author <a href="mailto:es...@op...">Esteban Sancho</a> */ public class FrameworkTestCaseSupport extends TestCase { public FrameworkTestCaseSupport() { super(); } public FrameworkTestCaseSupport(String arg0_) { super(arg0_); } protected SharedLibraryDesc getLibraryDescription(String name_, String version_) { SharedLibraryDesc desc = new SharedLibraryDesc(); IdentificationDesc id = new IdentificationDesc(); id.setName(name_); desc.setVersion(version_); desc.setIdentification(id); return desc; } protected ComponentDesc getComponentDescription(String name_) { ComponentDesc desc = new ComponentDesc(); IdentificationDesc id = new IdentificationDesc(); id.setName(name_); desc.setIdentification(id); return desc; } } Index: HashmapJBIRegistryImplTest.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/framework/impl/HashmapJBIRegistryImplTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HashmapJBIRegistryImplTest.java 9 Jun 2005 00:42:58 -0000 1.1 --- HashmapJBIRegistryImplTest.java 28 Jun 2005 03:02:31 -0000 1.2 *************** *** 16,27 **** package org.openbus.jbi.framework.impl; - import javax.transaction.TransactionManager; - import javax.transaction.UserTransaction; - - import junit.framework.TestCase; - import org.apache.commons.lang.SerializationUtils; ! import org.objectweb.jotm.Jotm; ! import org.openbus.commons.transaction.TransactionUtils; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.FrameworkException; --- 16,21 ---- package org.openbus.jbi.framework.impl; import org.apache.commons.lang.SerializationUtils; ! import org.openbus.jbi.descriptor.SharedLibraryDesc; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.FrameworkException; *************** *** 34,45 **** * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public class HashmapJBIRegistryImplTest extends TestCase { public void testAddSharedLibrary() { try { JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! SharedLibrary lib1 = new SharedLibrary(); ! lib1.setUniqueName("Lib 1"); ! lib1.setVersion("4.2"); reg.addSharedLibrary(lib1); assertEquals(1, reg.getSharedLibraries().size()); --- 28,38 ---- * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public class HashmapJBIRegistryImplTest extends FrameworkTestCaseSupport { public void testAddSharedLibrary() { try { JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! SharedLibrary lib1 = new SharedLibrary(getLibraryDescription( ! "Lib 1", "4.2")); reg.addSharedLibrary(lib1); assertEquals(1, reg.getSharedLibraries().size()); *************** *** 53,72 **** assertEquals(1, reg.getSharedLibraries().size()); // add 2nd lib with null version ! SharedLibrary lib2 = new SharedLibrary(); ! lib2.setUniqueName("Lib 2"); reg.addSharedLibrary(lib2); assertEquals(2, reg.getSharedLibraries().size()); // same lib NOW with version is not considered a duplicate ! lib2.setVersion("3.2"); reg.addSharedLibrary(lib2); assertEquals(3, reg.getSharedLibraries().size()); // add 3rd lib ! SharedLibrary lib3 = new SharedLibrary(); ! lib3.setUniqueName("Lib 3"); ! lib3.setVersion("3.2"); reg.addSharedLibrary(lib3); assertEquals(4, reg.getSharedLibraries().size()); // remove version and try to add it: it's OK ! lib3.setVersion(null); reg.addSharedLibrary(lib3); assertEquals(5, reg.getSharedLibraries().size()); --- 46,64 ---- assertEquals(1, reg.getSharedLibraries().size()); // add 2nd lib with null version ! SharedLibraryDesc desc2 = getLibraryDescription("Lib 2", null); ! SharedLibrary lib2 = new SharedLibrary(desc2); reg.addSharedLibrary(lib2); assertEquals(2, reg.getSharedLibraries().size()); // same lib NOW with version is not considered a duplicate ! desc2.setVersion("3.2"); reg.addSharedLibrary(lib2); assertEquals(3, reg.getSharedLibraries().size()); // add 3rd lib ! SharedLibraryDesc desc3 = getLibraryDescription("Lib 3", "3.2"); ! SharedLibrary lib3 = new SharedLibrary(desc3); reg.addSharedLibrary(lib3); assertEquals(4, reg.getSharedLibraries().size()); // remove version and try to add it: it's OK ! desc3.setVersion(null); reg.addSharedLibrary(lib3); assertEquals(5, reg.getSharedLibraries().size()); *************** *** 81,100 **** JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! SharedLibrary lib1 = new SharedLibrary(); ! lib1.setUniqueName("Lib 1"); ! lib1.setVersion("4.2"); reg.addSharedLibrary(lib1); assertEquals(1, reg.getSharedLibraries().size()); // add new version of Lib 1 ! lib1.setVersion("5.7"); reg.addSharedLibrary(lib1); assertEquals(2, reg.getSharedLibraries().size()); // add 2nd lib with null version ! SharedLibrary lib2 = new SharedLibrary(); ! lib2.setUniqueName("Lib 2"); reg.addSharedLibrary(lib2); assertEquals(3, reg.getSharedLibraries().size()); // same lib NOW with version is not considered a duplicate ! lib2.setVersion("3.2"); reg.addSharedLibrary(lib2); assertEquals(4, reg.getSharedLibraries().size()); --- 73,91 ---- JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! SharedLibraryDesc desc1 = getLibraryDescription("Lib 1", "4.2"); ! SharedLibrary lib1 = new SharedLibrary(desc1); reg.addSharedLibrary(lib1); assertEquals(1, reg.getSharedLibraries().size()); // add new version of Lib 1 ! desc1.setVersion("5.7"); reg.addSharedLibrary(lib1); assertEquals(2, reg.getSharedLibraries().size()); // add 2nd lib with null version ! SharedLibraryDesc desc2 = getLibraryDescription("Lib 2", null); ! SharedLibrary lib2 = new SharedLibrary(desc2); reg.addSharedLibrary(lib2); assertEquals(3, reg.getSharedLibraries().size()); // same lib NOW with version is not considered a duplicate ! desc2.setVersion("3.2"); reg.addSharedLibrary(lib2); assertEquals(4, reg.getSharedLibraries().size()); *************** *** 129,134 **** JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! Component comp1 = new Component(); ! comp1.setUniqueName("Comp 1"); reg.addComponent(comp1); assertEquals(1, reg.getComponents().size()); --- 120,124 ---- JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! Component comp1 = new Component(getComponentDescription("Comp 1")); reg.addComponent(comp1); assertEquals(1, reg.getComponents().size()); *************** *** 142,147 **** assertEquals(1, reg.getComponents().size()); // add 2nd comp ! Component comp2 = new Component(); ! comp2.setUniqueName("Comp 2"); reg.addComponent(comp2); assertEquals(2, reg.getComponents().size()); --- 132,136 ---- assertEquals(1, reg.getComponents().size()); // add 2nd comp ! Component comp2 = new Component(getComponentDescription("Comp 2")); reg.addComponent(comp2); assertEquals(2, reg.getComponents().size()); *************** *** 158,168 **** JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! Component comp1 = new Component(); ! comp1.setUniqueName("Comp 1"); reg.addComponent(comp1); assertEquals(1, reg.getComponents().size()); // add 2nd comp ! Component comp2 = new Component(); ! comp2.setUniqueName("Comp 2"); reg.addComponent(comp2); assertEquals(2, reg.getComponents().size()); --- 147,155 ---- JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! Component comp1 = new Component(getComponentDescription("Comp 1")); reg.addComponent(comp1); assertEquals(1, reg.getComponents().size()); // add 2nd comp ! Component comp2 = new Component(getComponentDescription("Comp 2")); reg.addComponent(comp2); assertEquals(2, reg.getComponents().size()); *************** *** 184,190 **** JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! SharedLibrary lib = new SharedLibrary(); ! lib.setUniqueName("Lib 1"); ! lib.setVersion("4.2"); reg.addSharedLibrary(lib); assertEquals(1, reg.getSharedLibraries().size()); --- 171,175 ---- JBIRegistry reg = new HashmapJBIRegistryImpl(); // add 1st library ! SharedLibrary lib = new SharedLibrary(getLibraryDescription("Lib 1", "4.2")); reg.addSharedLibrary(lib); assertEquals(1, reg.getSharedLibraries().size()); *************** *** 204,330 **** } - public void testRollback() { - Jotm jotm = null; - try { - // init registry - JBIRegistry reg = new HashmapJBIRegistryImpl(); - - // init Jotm - jotm = new Jotm(true, false); - TransactionManager tm = jotm.getTransactionManager(); - UserTransaction utx = jotm.getUserTransaction(); - utx.begin(); - - // late enlistment of resources - TransactionUtils.enlistResources(tm.getTransaction(), reg); - - // do work - Component comp1 = new Component(); - comp1.setUniqueName("Comp 1"); - reg.addComponent(comp1); - assertEquals(1, reg.getComponents().size()); - assertTrue("Now you see it...", reg.isComponentInstalled("Comp 1")); - // rollback and check the changes - utx.rollback(); - assertEquals(0, reg.getComponents().size()); - assertFalse("Now you don't", reg.isComponentInstalled("Comp 1")); - } catch (Exception e) { - e.printStackTrace(); - assertTrue("Exception caught -> " + e.getMessage(), false); - } finally { - jotm.stop(); - } - } - - public void testCommit() { - Jotm jotm = null; - try { - // init registry - JBIRegistry reg = new HashmapJBIRegistryImpl(); - - // init Jotm - jotm = new Jotm(true, false); - TransactionManager tm = jotm.getTransactionManager(); - tm.setTransactionTimeout(10000); - tm.begin(); - - // late enlistment of resources - TransactionUtils.enlistResources(tm.getTransaction(), reg); - - // do work - Component comp1 = new Component(); - comp1.setUniqueName("Comp 1"); - reg.addComponent(comp1); - assertEquals(1, reg.getComponents().size()); - assertTrue("Now you see it...", reg.isComponentInstalled("Comp 1")); - SharedLibrary lib1 = new SharedLibrary(); - lib1.setUniqueName("Lib 1"); - lib1.setVersion("4.2"); - reg.addSharedLibrary(lib1); - // check if other thread can see it - Intruder intruder = new Intruder(reg, jotm, false); - intruder.start(); - intruder.join(); - if (intruder.error != null) { - intruder.error.printStackTrace(); - assertTrue("Exception caught in thread: " - + intruder.error.getMessage(), false); - } - // late enlistment of resources - // commit and check in the other thread - tm.commit(); - assertEquals(1, reg.getComponents().size()); - assertTrue("I should see it", reg.isComponentInstalled("Comp 1")); - // check if other thread can see it - intruder = new Intruder(reg, jotm, true); - intruder.start(); - intruder.join(); - if (intruder.error != null) { - intruder.error.printStackTrace(); - assertTrue("Exception caught in thread: " - + intruder.error.getMessage(), false); - } - } catch (Exception e) { - e.printStackTrace(); - assertTrue("Exception caught -> " + e.getMessage(), false); - } finally { - jotm.stop(); - } - } - - private class Intruder extends Thread { - private JBIRegistry registry; - Jotm jotm; - boolean shouldSee; - Throwable error = null; - - private Intruder(JBIRegistry registry_, Jotm jotm_, boolean shouldSee_) { - registry = registry_; - jotm = jotm_; - shouldSee = shouldSee_; - } - - public void run() { - try { - TransactionManager tm = jotm.getTransactionManager(); - UserTransaction utx = jotm.getUserTransaction(); - utx.begin(); - - // late enlistment of resources - TransactionUtils.enlistResources(tm.getTransaction(), registry); - - // do work - if (shouldSee) { - assertTrue("I should see it", registry - .isComponentInstalled("Comp 1")); - } else { - assertFalse("I shouldn't see it", registry - .isComponentInstalled("Comp 1")); - } - utx.commit(); - } catch (Throwable t) { - error = t; - } - } - } } \ No newline at end of file --- 189,191 ---- |
|
From: Esteban S. <es...@us...> - 2005-06-28 03:02:39
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959/src/java/org/openbus/jbi/framework Modified Files: JBIRegistry.java JBIRepository.java Component.java SharedLibrary.java Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. Index: Component.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/Component.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Component.java 9 Jun 2005 00:42:57 -0000 1.1 --- Component.java 28 Jun 2005 03:02:31 -0000 1.2 *************** *** 17,20 **** --- 17,21 ---- import java.io.Serializable; + import java.util.Collection; import org.openbus.jbi.descriptor.ComponentDesc; *************** *** 28,48 **** private ComponentDesc descriptor; ! private String uniqueName; ! public ComponentDesc getDescriptor() { ! return descriptor; } ! public void setDescriptor(ComponentDesc descriptor_) { ! descriptor = descriptor_; ! uniqueName = descriptor_.getIdentification().getName(); } ! public String getUniqueName() { ! return uniqueName; } ! public void setUniqueName(String uniqueName_) { ! uniqueName = uniqueName_; } } \ No newline at end of file --- 29,50 ---- private ComponentDesc descriptor; ! public Component(ComponentDesc descriptor_) { ! setDescriptor(descriptor_); ! } ! public String getUniqueName() { ! return getDescriptor().getIdentification().getName(); } ! public Collection getDependencies() { ! return getDescriptor().getRequiredLibraries(); } ! public ComponentDesc getDescriptor() { ! return descriptor; } ! public void setDescriptor(ComponentDesc descriptor_) { ! descriptor = descriptor_; } } \ No newline at end of file Index: SharedLibrary.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/SharedLibrary.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SharedLibrary.java 9 Jun 2005 00:42:57 -0000 1.1 --- SharedLibrary.java 28 Jun 2005 03:02:31 -0000 1.2 *************** *** 26,61 **** */ public class SharedLibrary implements Serializable { public static final String DEFAULT_LIB_VERSION = "default"; ! private SharedLibraryDesc descriptor; ! ! private String uniqueName; ! private String version; ! public SharedLibraryDesc getDescriptor() { ! return descriptor; } ! public void setDescriptor(SharedLibraryDesc descriptor_) { ! descriptor = descriptor_; ! uniqueName = descriptor_.getIdentification().getName(); ! version = descriptor_.getVersion(); } public String getUniqueName() { ! return uniqueName; } ! public void setUniqueName(String uniqueName_) { ! uniqueName = uniqueName_; } ! public String getVersion() { ! return version; } ! public void setVersion(String version_) { ! version = version_; } } \ No newline at end of file --- 26,92 ---- */ public class SharedLibrary implements Serializable { + public static final String STATUS_NEW = "new"; + public static final String STATUS_INSTALLED = "installed"; public static final String DEFAULT_LIB_VERSION = "default"; ! SharedLibraryDesc descriptor; ! private String installRoot; ! private String status; ! public SharedLibrary(SharedLibraryDesc descriptor_) { ! setDescriptor(descriptor_); ! status = STATUS_NEW; ! } ! public String getStatus() { ! return status; } ! public void setStatus(String status_) { ! if (!status_.equals(STATUS_NEW) || !status_.equals(STATUS_INSTALLED)) { ! // @todo i18n ! throw new IllegalArgumentException( ! "Parameter status_ can only be SharedLibrary.STATUS_NEW " ! + "or SharedLibrary.STATUS_INSTALLED"); ! } ! status = status_; } public String getUniqueName() { ! return getDescriptor().getIdentification().getName(); } ! public String getVersion() { ! return getDescriptor().getVersion(); } ! public String getInstallRoot() { ! return installRoot; } ! public void setInstallRoot(String installRoot_) { ! installRoot = installRoot_; ! } ! ! public boolean equals(Object obj_) { ! boolean equals = false; ! if (obj_ instanceof SharedLibrary) { ! SharedLibrary theOther = (SharedLibrary) obj_; ! equals = getUniqueName().equals(theOther.getUniqueName()) ! && getVersion().equals(theOther.getVersion()); ! } ! return equals; ! } ! ! public int hashCode() { ! return 13 + getUniqueName().hashCode() + getVersion().hashCode(); ! } ! ! public SharedLibraryDesc getDescriptor() { ! return descriptor; ! } ! ! public void setDescriptor(SharedLibraryDesc descriptor_) { ! descriptor = descriptor_; } } \ No newline at end of file Index: JBIRegistry.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/JBIRegistry.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JBIRegistry.java 9 Jun 2005 00:42:57 -0000 1.1 --- JBIRegistry.java 28 Jun 2005 03:02:30 -0000 1.2 *************** *** 19,24 **** import java.util.Collection; - import org.openbus.commons.transaction.XAComposite; - /** * --- 19,22 ---- *************** *** 26,30 **** * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public interface JBIRegistry extends Serializable, Cloneable, XAComposite { /** * --- 24,28 ---- * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public interface JBIRegistry extends Serializable, Cloneable { /** * Index: JBIRepository.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/framework/JBIRepository.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JBIRepository.java 16 Jun 2005 03:35:38 -0000 1.2 --- JBIRepository.java 28 Jun 2005 03:02:31 -0000 1.3 *************** *** 16,22 **** package org.openbus.jbi.framework; - - import org.openbus.commons.transaction.XAComposite; - /** * --- 16,19 ---- *************** *** 24,28 **** * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public interface JBIRepository extends XAComposite { String storeRegistry(JBIRegistry registry_) throws FrameworkException; --- 21,25 ---- * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ ! public interface JBIRepository { String storeRegistry(JBIRegistry registry_) throws FrameworkException; |
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/install/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12959/src/java/org/openbus/jbi/install/impl Added Files: DefaultJBIInstallerImpl.java Removed Files: InstallationConfig.java SharedLibraryInstallerImpl.java AbstractInstaller.java Log Message: Removing transactional logic from repository and registry. Refactoring to regular filesystems and HashMaps. --- NEW FILE: DefaultJBIInstallerImpl.java --- /* * Copyright 2001-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. */ package org.openbus.jbi.install.impl; import java.io.IOException; import java.util.Collection; import java.util.Iterator; import java.util.zip.ZipFile; import javax.management.ObjectName; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openbus.commons.transaction.JTAFactory; import org.openbus.jbi.descriptor.JBIDesc; import org.openbus.jbi.framework.Component; import org.openbus.jbi.framework.FrameworkException; import org.openbus.jbi.framework.JBIRegistry; import org.openbus.jbi.framework.JBIRepository; import org.openbus.jbi.framework.SharedLibrary; import org.openbus.jbi.install.InstallationException; import org.openbus.jbi.install.JBIInstaller; import org.openbus.jbi.install.PackageParser; /** * * * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ public class DefaultJBIInstallerImpl implements JBIInstaller { private PackageParser parser; private JBIRepository repository; private JBIRegistry registry; private JTAFactory jtaFactory; private static Log log = LogFactory.getLog(DefaultJBIInstallerImpl.class); public void init() throws InstallationException { if (repository == null) { // @todo i18n throw new InstallationException("JBIRepository implementation " + "is not available"); } try { registry = repository.retrieveRegistry(); } catch (FrameworkException e) { // @todo i18n throw new InstallationException("Error on initialization", e); } } public void shutdown() throws InstallationException { } protected JBIDesc getDescriptor(String slZipURL_) throws InstallationException { JBIDesc descriptor = null; try { ZipFile zip = new ZipFile(slZipURL_); descriptor = getParser().getDescriptor(zip); } catch (IOException e) { // @todo i18n throw new InstallationException( "Unable to get descriptor from file " + slZipURL_, e); } return descriptor; } public String installSharedLibrary(String slZipURL_) throws InstallationException { String libraryName = null; try { SharedLibrary lib = new SharedLibrary(getDescriptor(slZipURL_) .getSharedLibrary()); libraryName = lib.getUniqueName(); String libRoot = getRepository().storeSharedLibrary(lib, slZipURL_); lib.setInstallRoot(libRoot); lib.setStatus(SharedLibrary.STATUS_INSTALLED); getRegistry().addSharedLibrary(lib); getRepository().storeRegistry(getRegistry()); } catch (Exception e) { // @todo i18n throw new InstallationException("Unable to install shared library " + libraryName, e); } return libraryName; } protected void checkDependencies(SharedLibrary library_) throws InstallationException { Collection components = getRegistry().getComponents(); for (Iterator i = components.iterator(); i.hasNext();) { Component comp = (Component) i.next(); if (comp.getDependencies().contains(library_)) { // @todo i18n throw new InstallationException("Component " + comp.getUniqueName() + " depends on shared library " + library_.getUniqueName() + " with version " + library_.getVersion()); } } } public void uninstallSharedLibrary(String slName_) throws InstallationException { SharedLibrary lib = registry.getSharedLibrary(slName_); if (lib == null) { // @todo i18n throw new InstallationException("Shared library not installed: " + slName_); } checkDependencies(lib); try { getRegistry().removeSharedLibrary(slName_); getRepository().removeSharedLibrary(lib); getRepository().storeRegistry(getRegistry()); } catch (Exception e) { // @todo i18n throw new InstallationException( "Unable to uninstall shared library " + slName_, e); } } public ObjectName loadInstaller(String componentName_) { // @todo Auto-generated method stub return null; } public ObjectName loadNewInstaller(String installZipURL_) { // @todo Auto-generated method stub return null; } public void unloadInstaller(String componentName_, boolean isToBeDeleted_) { // @todo Auto-generated method stub } public JTAFactory getJtaFactory() { return jtaFactory; } public void setJtaFactory(JTAFactory jtaFactory_) { jtaFactory = jtaFactory_; } public PackageParser getParser() { return parser; } public void setParser(PackageParser parser_) { parser = parser_; } public JBIRegistry getRegistry() { return registry; } public void setRepository(JBIRepository repository_) { repository = repository_; } public JBIRepository getRepository() { return repository; } } --- InstallationConfig.java DELETED --- --- AbstractInstaller.java DELETED --- --- SharedLibraryInstallerImpl.java DELETED --- |
|
From: Esteban S. <es...@us...> - 2005-06-28 02:51:35
|
Update of /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6475/src/java/org/openbus/commons/util Added Files: ZipUtils.java Log Message: Refactoring ZipUtils to use a regular filesystem instead of transactional one --- NEW FILE: ZipUtils.java --- /* * Copyright 2001-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. */ package org.openbus.commons.util; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ public class ZipUtils { private static final Log log = LogFactory.getLog(ZipUtils.class); private static final int BUFFER = 2048; public static void inflate(String zipFile_, File directory_) throws IOException { ZipInputStream zis = new ZipInputStream(new BufferedInputStream( new FileInputStream(zipFile_))); ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { File newFile = new File(directory_, entry.getName()); if (entry.isDirectory()) { if (log.isDebugEnabled()) { log.debug("Creating directory " + entry); } FileUtils.forceMkdir(newFile); } else { if (log.isDebugEnabled()) { log.debug("Inflating file " + entry.getName()); } if (!newFile.getParentFile().exists()) { FileUtils.forceMkdir(newFile.getParentFile()); } OutputStream os = new BufferedOutputStream( new FileOutputStream(newFile), BUFFER); byte[] data = new byte[BUFFER]; int count; while ((count = zis.read(data, 0, BUFFER)) != -1) { os.write(data, 0, count); } // close resources os.close(); } } zis.close(); } } |
|
From: Esteban S. <es...@us...> - 2005-06-28 02:51:35
|
Update of /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/transaction/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6475/src/java/org/openbus/commons/transaction/impl Removed Files: ZipUtils.java Log Message: Refactoring ZipUtils to use a regular filesystem instead of transactional one --- ZipUtils.java DELETED --- |
|
From: Esteban S. <es...@us...> - 2005-06-28 02:51:27
|
Update of /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6299/src/java/org/openbus/commons/util Log Message: Directory /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/util added to the repository |
|
From: Diego E. <er...@us...> - 2005-06-27 03:12:09
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/messaging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8433/src/java/org/openbus/jbi/messaging Modified Files: DeliveryChannelImpl.java NMRServiceImpl.java Removed Files: NMRLocator.java Log Message: added tests Index: DeliveryChannelImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/messaging/DeliveryChannelImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DeliveryChannelImpl.java 25 Jun 2005 22:25:16 -0000 1.11 --- DeliveryChannelImpl.java 27 Jun 2005 03:11:57 -0000 1.12 *************** *** 55,59 **** */ public DeliveryChannelImpl(String comp) { - this.nmr = NMRLocator.findNMR(); this.component = comp; } --- 55,58 ---- *************** *** 339,341 **** --- 338,344 ---- } + public void setNmr(NMRService nmr) { + this.nmr = nmr; + } + } --- NMRLocator.java DELETED --- Index: NMRServiceImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/messaging/NMRServiceImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NMRServiceImpl.java 21 Jun 2005 00:13:53 -0000 1.6 --- NMRServiceImpl.java 27 Jun 2005 03:11:57 -0000 1.7 *************** *** 253,256 **** --- 253,258 ---- if (dc == null) { dc = new DeliveryChannelImpl(component); + // TODO do this in hivemind configuration + ((DeliveryChannelImpl)dc).setNmr(this); deliveryChannelByComponent.put(component, dc); |
|
From: Diego E. <er...@us...> - 2005-06-27 03:12:09
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/messaging/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8433/src/test/org/openbus/jbi/messaging/examples Modified Files: ComponentLauncher.java Log Message: added tests Index: ComponentLauncher.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/messaging/examples/ComponentLauncher.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ComponentLauncher.java 21 Jun 2005 00:18:05 -0000 1.1 --- ComponentLauncher.java 27 Jun 2005 03:11:57 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- import org.openbus.jbi.component.ComponentContextImpl; import org.openbus.jbi.messaging.ComponentRepository; + import org.openbus.jbi.messaging.NMRService; /** *************** *** 17,20 **** --- 18,23 ---- private static Log log = LogFactory.getLog(ComponentLauncher.class); + private static NMRService nmr; + boolean running = false; *************** *** 23,29 **** Component component; ! public ComponentLauncher(String componentName_, Component component_) { component = component_; componentName = componentName_; } --- 26,33 ---- Component component; ! public ComponentLauncher(String componentName_, Component component_, NMRService nmr_) { component = component_; componentName = componentName_; + nmr = nmr_; } *************** *** 41,45 **** try { ComponentRepository.getInstance().addComponent(componentName, component); ! clc.init(new ComponentContextImpl(componentName)); running = true; log.info("" + componentName + " initialized."); --- 45,51 ---- try { ComponentRepository.getInstance().addComponent(componentName, component); ! ComponentContextImpl ctxtImpl = new ComponentContextImpl(componentName); ! ctxtImpl.setNmr(nmr); ! clc.init(ctxtImpl); running = true; log.info("" + componentName + " initialized."); |
|
From: Diego E. <er...@us...> - 2005-06-27 03:12:09
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/component In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8433/src/java/org/openbus/jbi/component Modified Files: ComponentContextImpl.java Log Message: added tests Index: ComponentContextImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/component/ComponentContextImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ComponentContextImpl.java 21 Jun 2005 00:16:41 -0000 1.7 --- ComponentContextImpl.java 27 Jun 2005 03:11:56 -0000 1.8 *************** *** 17,21 **** import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.openbus.jbi.messaging.NMRLocator; import org.openbus.jbi.messaging.NMRService; import org.w3c.dom.Document; --- 17,20 ---- *************** *** 43,47 **** log.debug("new ComponentContext created for component : " + componentName_); componentName = componentName_; - nmr = NMRLocator.findNMR(); } --- 42,45 ---- *************** *** 197,199 **** --- 195,201 ---- } + public void setNmr(NMRService nmr_) { + nmr = nmr_; + } + } |
|
From: Diego E. <er...@us...> - 2005-06-27 03:12:09
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8433 Modified Files: project.xml Log Message: added tests Index: project.xml =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** project.xml 24 Jun 2005 15:33:54 -0000 1.10 --- project.xml 27 Jun 2005 03:11:56 -0000 1.11 *************** *** 65,68 **** --- 65,73 ---- <dependencies> <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> <groupId>hivemind</groupId> <artifactId>hivemind</artifactId> |
|
From: Diego E. <er...@us...> - 2005-06-27 03:12:09
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/messaging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8433/src/test/org/openbus/jbi/messaging Modified Files: SpecificationExamplesTest.java Added Files: DeliveryChannelImplTest.java Log Message: added tests Index: SpecificationExamplesTest.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/messaging/SpecificationExamplesTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpecificationExamplesTest.java 21 Jun 2005 00:17:48 -0000 1.1 --- SpecificationExamplesTest.java 27 Jun 2005 03:11:56 -0000 1.2 *************** *** 29,33 **** assertTrue(serverDir.mkdir()); ! nmr = NMRLocator.findNMR(); nmr.getJMSAdmin().setProperty(JoramJMSAdmin.ROOT_DIR_PROP, serverDir.getAbsolutePath()); --- 29,33 ---- assertTrue(serverDir.mkdir()); ! nmr = new NMRServiceImpl(); nmr.getJMSAdmin().setProperty(JoramJMSAdmin.ROOT_DIR_PROP, serverDir.getAbsolutePath()); *************** *** 58,63 **** public void testInOnly() { SoapBinding sb = new SoapBinding(); ! ComponentLauncher sbc = new ComponentLauncher("SOAP_Binding_ComponentIN", ! sb); sbc.start(); --- 58,63 ---- public void testInOnly() { SoapBinding sb = new SoapBinding(); ! ComponentLauncher sbc = new ComponentLauncher( ! "SOAP_Binding_ComponentIN", sb, nmr); sbc.start(); *************** *** 73,77 **** ConsumerEngine ce = new ConsumerEngine(); ComponentLauncher cec = new ComponentLauncher( ! "Consumer_Engine_ComponentIN", ce); cec.start(); --- 73,77 ---- ConsumerEngine ce = new ConsumerEngine(); ComponentLauncher cec = new ComponentLauncher( ! "Consumer_Engine_ComponentIN", ce, nmr); cec.start(); *************** *** 86,90 **** org.openbus.jbi.messaging.examples.inout.ConsumerEngine ce = new org.openbus.jbi.messaging.examples.inout.ConsumerEngine(); ComponentLauncher cec = new ComponentLauncher( ! "Consumer_Engine_ComponentINOUT", ce); cec.start(); --- 86,90 ---- org.openbus.jbi.messaging.examples.inout.ConsumerEngine ce = new org.openbus.jbi.messaging.examples.inout.ConsumerEngine(); ComponentLauncher cec = new ComponentLauncher( ! "Consumer_Engine_ComponentINOUT", ce, nmr); cec.start(); *************** *** 99,104 **** org.openbus.jbi.messaging.examples.inout.SoapBinding sb = new org.openbus.jbi.messaging.examples.inout.SoapBinding(); ! ComponentLauncher sbc = new ComponentLauncher("SOAP_Binding_ComponentINOUT", ! sb); sbc.start(); --- 99,104 ---- org.openbus.jbi.messaging.examples.inout.SoapBinding sb = new org.openbus.jbi.messaging.examples.inout.SoapBinding(); ! ComponentLauncher sbc = new ComponentLauncher( ! "SOAP_Binding_ComponentINOUT", sb, nmr); sbc.start(); --- NEW FILE: DeliveryChannelImplTest.java --- package org.openbus.jbi.messaging; import javax.jbi.messaging.MessageExchange; import javax.jbi.messaging.MessageExchangeFactory; import javax.jbi.messaging.MessagingException; import javax.jbi.servicedesc.ServiceEndpoint; import javax.xml.namespace.QName; import org.jmock.Mock; import org.jmock.MockObjectTestCase; public class DeliveryChannelImplTest extends MockObjectTestCase { DeliveryChannelImpl deliveryChannel; Mock mockNMR; public DeliveryChannelImplTest(String arg0) { super(arg0); } protected void setUp() throws Exception { super.setUp(); deliveryChannel = new DeliveryChannelImpl("testComponent"); mockNMR = new Mock(NMRService.class); deliveryChannel.setNmr((NMRService) mockNMR.proxy()); } protected void tearDown() throws Exception { super.tearDown(); deliveryChannel = null; mockNMR = null; } protected final String EXCHANGE_TEST_UID = "uid"; protected void prepareNMRUid() { mockNMR.expects(once()).method("getUniqueExchangeId").withNoArguments() .will(returnValue(EXCHANGE_TEST_UID)); } /* * Class under test for MessageExchange accept() */ public void testAccept() throws Exception { } /* * Class under test for MessageExchange accept(long) */ public void testAcceptlong() { } public void testSend() { } /* * Class under test for boolean sendSynch(MessageExchange) */ public void testSendSynchMessageExchange() { } /* * Class under test for boolean sendSynch(MessageExchange, long) */ public void testSendSynchMessageExchangelong() { } /* * Class under test for MessageExchangeFactory createExchangeFactory() */ public void testCreateExchangeFactory() throws Exception { prepareNMRUid(); MessageExchangeFactory ef = deliveryChannel.createExchangeFactory(); MessageExchange ex = ef.createInOnlyExchange(); assertNull(ex.getEndpoint()); assertNull(ex.getInterfaceName()); assertNull(ex.getOperation()); assertNull(ex.getService()); assertNull(ex.getService()); assertEquals(EXCHANGE_TEST_UID, ex.getExchangeId()); } /* * Class under test for MessageExchangeFactory createExchangeFactory(QName) */ public void testCreateExchangeFactoryQName() throws Exception { prepareNMRUid(); QName ifaceName = new QName("testqname"); MessageExchangeFactory ef = deliveryChannel .createExchangeFactory(ifaceName); MessageExchange ex = ef.createInOnlyExchange(); assertNull(ex.getEndpoint()); assertNull(ex.getOperation()); assertNull(ex.getService()); assertEquals("Interface name", ifaceName, ex.getInterfaceName()); assertEquals(EXCHANGE_TEST_UID, ex.getExchangeId()); } /* * Class under test for MessageExchangeFactory * createExchangeFactory(ServiceEndpoint) */ public void testCreateExchangeFactoryServiceEndpoint() throws Exception { prepareNMRUid(); ServiceEndpoint se = (ServiceEndpoint) new Mock(ServiceEndpoint.class) .proxy(); MessageExchangeFactory ef = deliveryChannel.createExchangeFactory(se); MessageExchange ex = ef.createInOnlyExchange(); assertNull(ex.getOperation()); assertNull(ex.getService()); assertNull(ex.getInterfaceName()); assertEquals("Service endpoint", se, ex.getEndpoint()); assertEquals(EXCHANGE_TEST_UID, ex.getExchangeId()); } public void testCreateExchangeFactoryForService() throws Exception { prepareNMRUid(); QName serviceName = new QName("testqname"); MessageExchangeFactory ef = deliveryChannel .createExchangeFactoryForService(serviceName); MessageExchange ex = ef.createInOnlyExchange(); assertNull(ex.getEndpoint()); assertNull(ex.getOperation()); assertNull(ex.getInterfaceName()); assertEquals("Interface name", serviceName, ex.getService()); assertEquals(EXCHANGE_TEST_UID, ex.getExchangeId()); } public void testClose() throws Exception { deliveryChannel.close(); MessageExchange me = (MessageExchange) new Mock(MessageExchange.class) .proxy(); try { MessageExchange exchange = deliveryChannel.accept(); fail("Channel is closed"); } catch (MessagingException e) { } try { MessageExchange exchange = deliveryChannel.accept(1000); fail("Channel is closed"); } catch (MessagingException e) { } try { deliveryChannel.send(me); fail("Channel is closed"); } catch (MessagingException e) { } try { deliveryChannel.sendSynch(me); fail("Channel is closed"); } catch (MessagingException e) { } try { deliveryChannel.sendSynch(me, 1000); fail("Channel is closed"); } catch (MessagingException e) { } } } |
|
From: Esteban S. <es...@us...> - 2005-06-26 22:48:32
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29492/src/java/org/openbus/jbi/server Modified Files: ServerController.java Log Message: Commenting code that wasn't compiling Index: ServerController.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/ServerController.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerController.java 22 Apr 2005 02:39:00 -0000 1.1 --- ServerController.java 26 Jun 2005 22:48:24 -0000 1.2 *************** *** 80,133 **** private void parseCmdLine(String[] args) throws OpenbusException { ! HashMap commands = new HashMap(); ! commands.put("start", new ServerStarter()); ! commands.put("stop", new ServerStopper()); ! ! ResourceBundle bundle = ResourceBundleFinder.getInstance() ! .find(getClass()); ! ! Options opt = new Options(); ! Option cmdOpt = new Option("c", COMD, true, bundle.getString(ControllerKeys.ARGS_COMD)); ! cmdOpt.setRequired(true); ! ! opt.addOption(cmdOpt); ! opt.addOption(USER, USER_S, true, bundle.getString(ControllerKeys.ARGS_USER)); ! opt.addOption(PASS, PASS_S, true, bundle.getString(ControllerKeys.ARGS_PASS)); ! opt.addOption(HELP, HELP_S, false, bundle.getString(ControllerKeys.ARGS_HELP)); ! opt.addOption(FILE, FILE_S, true, bundle.getString(ControllerKeys.ARGS_FILE)); ! ! CommandLineParser parser = new PosixParser(); ! CommandLine cmd = null; ! ! try { ! cmd = parser.parse(opt, args); ! } catch (ParseException e) { ! printUsage(cmd, opt); ! throw new OpenbusRuntimeException(e); ! } ! ! if (cmd.hasOption(HELP_S)) { ! printUsage(cmd, opt); ! return; ! } ! ! String cmdName = cmd.getOptionValue(COMD_S); ! if (cmdName == null || ! !commands.containsKey(cmdName)) { ! log.fatal("[" + cmdName + "] " ! + bundle.getString(ControllerKeys.ERR_INVALID_COMMAND)); ! printUsage(cmd, opt); ! } ! ! String userName = null; ! String password = null; ! ! if (cmd.hasOption(USER_S)) userName = cmd.getOptionValue(USER_S); ! if (cmd.hasOption(PASS_S)) userName = cmd.getOptionValue(PASS_S); ! ! // do command logic ! ServerCommand command = (ServerCommand)commands.get(cmdName); ! command.doCommand(cmd); ! } --- 80,133 ---- private void parseCmdLine(String[] args) throws OpenbusException { ! // HashMap commands = new HashMap(); ! // commands.put("start", new ServerStarter()); ! // commands.put("stop", new ServerStopper()); ! // ! // ResourceBundle bundle = ResourceBundleFinder.getInstance() ! // .find(getClass()); ! // ! // Options opt = new Options(); ! // Option cmdOpt = new Option("c", COMD, true, bundle.getString(ControllerKeys.ARGS_COMD)); ! // cmdOpt.setRequired(true); ! // ! // opt.addOption(cmdOpt); ! // opt.addOption(USER, USER_S, true, bundle.getString(ControllerKeys.ARGS_USER)); ! // opt.addOption(PASS, PASS_S, true, bundle.getString(ControllerKeys.ARGS_PASS)); ! // opt.addOption(HELP, HELP_S, false, bundle.getString(ControllerKeys.ARGS_HELP)); ! // opt.addOption(FILE, FILE_S, true, bundle.getString(ControllerKeys.ARGS_FILE)); ! // ! // CommandLineParser parser = new PosixParser(); ! // CommandLine cmd = null; ! // ! // try { ! // cmd = parser.parse(opt, args); ! // } catch (ParseException e) { ! // printUsage(cmd, opt); ! // throw new OpenbusRuntimeException(e); ! // } ! // ! // if (cmd.hasOption(HELP_S)) { ! // printUsage(cmd, opt); ! // return; ! // } ! // ! // String cmdName = cmd.getOptionValue(COMD_S); ! // if (cmdName == null || ! // !commands.containsKey(cmdName)) { ! // log.fatal("[" + cmdName + "] " ! // + bundle.getString(ControllerKeys.ERR_INVALID_COMMAND)); ! // printUsage(cmd, opt); ! // } ! // ! // String userName = null; ! // String password = null; ! // ! // if (cmd.hasOption(USER_S)) userName = cmd.getOptionValue(USER_S); ! // if (cmd.hasOption(PASS_S)) userName = cmd.getOptionValue(PASS_S); ! // ! // // do command logic ! // ServerCommand command = (ServerCommand)commands.get(cmdName); ! // command.doCommand(cmd); ! // } |
|
From: Esteban S. <es...@us...> - 2005-06-26 22:48:32
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/commands/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29492/src/java/org/openbus/jbi/server/commands/impl Modified Files: ServerStarter.java ServerStopper.java Log Message: Commenting code that wasn't compiling Index: ServerStarter.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/commands/impl/ServerStarter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerStarter.java 22 Apr 2005 02:39:00 -0000 1.1 --- ServerStarter.java 26 Jun 2005 22:48:24 -0000 1.2 *************** *** 56,112 **** */ public void doCommand(CommandLine cmd) throws OpenbusException { ! String confFile = null; ! ConfigurationFacade conf = ConfigurationFacade.getInstance(); ! ! // if a file name is provided in the command line, then override ! // the configured one. ! if (cmd.hasOption(ServerController.FILE)) ! confFile = cmd.getOptionValue(ServerController.FILE); ! else ! confFile = conf.getRootDir().concat( ! conf.getConfig().getString( ! CommandsKeys.JMX_STARTUP_CONF_FILE)); ! ! if (confFile == null) ! throw new OpenbusConfigurationException( ! CommandsKeys.ERR_NO_JMX_FILE); ! ! File file = new File(confFile); ! if (!file.exists()) ! throw new OpenbusConfigurationException( ! CommandsKeys.ERR_NO_JMX_FILE); ! ! // start server instance ! MBeanServer server = MBeanServerFactory.newMBeanServer(); ! ConfigurationLoader loader = new ConfigurationLoader(); ! ! ResourceBundle bundle = ResourceBundleFinder.getInstance().find(getClass()); ! ! // register configuration loader ! log.info(bundle.getString(CommandsKeys.START_REGISTERING_CONF_LOADER)); ! try { ! server.registerMBean(loader, ObjectName ! .getInstance("config:service=loader")); ! } catch (Exception ex) { ! throw new OpenbusException( ! bundle.getString(CommandsKeys.ERR_REGISTERING_CONF_LOADER), ex); ! } ! ! // load configuration from file ! log.info(bundle.getString(CommandsKeys.START_LOADING_CONF)); ! try { ! Reader reader = new BufferedReader(new FileReader(confFile)); ! ! // start jmx server with supplied configuration ! loader.startup(reader); ! ! // free reader ! reader.close(); ! } catch (Exception ex) { ! throw new OpenbusException( ! bundle.getString(CommandsKeys.ERR_LOADING_CONF), ex); ! } ! ! log.info(bundle.getString(CommandsKeys.START_FINISH)); } --- 56,112 ---- */ public void doCommand(CommandLine cmd) throws OpenbusException { ! // String confFile = null; ! // ConfigurationFacade conf = ConfigurationFacade.getInstance(); ! // ! // // if a file name is provided in the command line, then override ! // // the configured one. ! // if (cmd.hasOption(ServerController.FILE)) ! // confFile = cmd.getOptionValue(ServerController.FILE); ! // else ! // confFile = conf.getRootDir().concat( ! // conf.getConfig().getString( ! // CommandsKeys.JMX_STARTUP_CONF_FILE)); ! // ! // if (confFile == null) ! // throw new OpenbusConfigurationException( ! // CommandsKeys.ERR_NO_JMX_FILE); ! // ! // File file = new File(confFile); ! // if (!file.exists()) ! // throw new OpenbusConfigurationException( ! // CommandsKeys.ERR_NO_JMX_FILE); ! // ! // // start server instance ! // MBeanServer server = MBeanServerFactory.newMBeanServer(); ! // ConfigurationLoader loader = new ConfigurationLoader(); ! // ! // ResourceBundle bundle = ResourceBundleFinder.getInstance().find(getClass()); ! // ! // // register configuration loader ! // log.info(bundle.getString(CommandsKeys.START_REGISTERING_CONF_LOADER)); ! // try { ! // server.registerMBean(loader, ObjectName ! // .getInstance("config:service=loader")); ! // } catch (Exception ex) { ! // throw new OpenbusException( ! // bundle.getString(CommandsKeys.ERR_REGISTERING_CONF_LOADER), ex); ! // } ! // ! // // load configuration from file ! // log.info(bundle.getString(CommandsKeys.START_LOADING_CONF)); ! // try { ! // Reader reader = new BufferedReader(new FileReader(confFile)); ! // ! // // start jmx server with supplied configuration ! // loader.startup(reader); ! // ! // // free reader ! // reader.close(); ! // } catch (Exception ex) { ! // throw new OpenbusException( ! // bundle.getString(CommandsKeys.ERR_LOADING_CONF), ex); ! // } ! // ! // log.info(bundle.getString(CommandsKeys.START_FINISH)); } Index: ServerStopper.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/commands/impl/ServerStopper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerStopper.java 22 Apr 2005 02:39:00 -0000 1.1 --- ServerStopper.java 26 Jun 2005 22:48:24 -0000 1.2 *************** *** 45,75 **** */ public void doCommand(CommandLine cmd) throws OpenbusException { ! ResourceBundle bundle = ResourceBundleFinder.getInstance().find(getClass()); ! ! String shutdownCommand = "shutdown"; ! Socket socket = null; ! ! try { ! log.info(bundle.getString(CommandsKeys.STOP_OPENING_SOCKET)); ! socket = new Socket("127.0.0.1", 9876); ! ! log.info(bundle.getString(CommandsKeys.STOP_SENDING_COMMAND)); ! socket.getOutputStream().write(shutdownCommand.getBytes()); ! ! } catch (IOException ex) { ! throw new OpenbusException( ! bundle.getString(CommandsKeys.ERR_COMMUNICATING_SERVER), ex); ! } finally { ! if (socket != null) { ! try { ! socket.close(); ! } catch (IOException ex) { ! throw new OpenbusException(bundle.getString( ! CommandsKeys.ERR_COMMUNICATING_SERVER), ex); ! } ! } ! } ! ! log.info(bundle.getString(CommandsKeys.STOP_FINISH)); } --- 45,75 ---- */ public void doCommand(CommandLine cmd) throws OpenbusException { ! // ResourceBundle bundle = ResourceBundleFinder.getInstance().find(getClass()); ! // ! // String shutdownCommand = "shutdown"; ! // Socket socket = null; ! // ! // try { ! // log.info(bundle.getString(CommandsKeys.STOP_OPENING_SOCKET)); ! // socket = new Socket("127.0.0.1", 9876); ! // ! // log.info(bundle.getString(CommandsKeys.STOP_SENDING_COMMAND)); ! // socket.getOutputStream().write(shutdownCommand.getBytes()); ! // ! // } catch (IOException ex) { ! // throw new OpenbusException( ! // bundle.getString(CommandsKeys.ERR_COMMUNICATING_SERVER), ex); ! // } finally { ! // if (socket != null) { ! // try { ! // socket.close(); ! // } catch (IOException ex) { ! // throw new OpenbusException(bundle.getString( ! // CommandsKeys.ERR_COMMUNICATING_SERVER), ex); ! // } ! // } ! // } ! // ! // log.info(bundle.getString(CommandsKeys.STOP_FINISH)); } |
|
From: Esteban S. <es...@us...> - 2005-06-26 22:36:08
|
Update of /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/i18n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22515/src/java/org/openbus/commons/i18n Modified Files: ResourceBundleLoader.java ResourceBundleFinderImpl.java Log Message: Commenting code that wasn't compiling Index: ResourceBundleLoader.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/i18n/ResourceBundleLoader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceBundleLoader.java 7 May 2005 13:18:40 -0000 1.1 --- ResourceBundleLoader.java 26 Jun 2005 22:35:56 -0000 1.2 *************** *** 44,61 **** */ public static ResourceBundle getBundle(Class clazz) { ! ResourceBundleFinder bundleFinder = (ResourceBundleFinder)ServiceLocator ! .findImplementationOf(ResourceBundleFinder.class); ! ! ResourceBundle bundle = null; ! ! if (bundleFinder != null) { ! bundle = bundleFinder.find(clazz); ! } else { ! throw new OpenbusConfigurationException("No implementation found " ! + "for service " + ResourceBundleFinder.class.getName()); ! } ! ! return bundle; ! } /** --- 44,62 ---- */ public static ResourceBundle getBundle(Class clazz) { ! // ResourceBundleFinder bundleFinder = (ResourceBundleFinder)ServiceLocator ! // .findImplementationOf(ResourceBundleFinder.class); ! // ! // ResourceBundle bundle = null; ! // ! // if (bundleFinder != null) { ! // bundle = bundleFinder.find(clazz); ! // } else { ! // throw new OpenbusConfigurationException("No implementation found " ! // + "for service " + ResourceBundleFinder.class.getName()); ! // } ! // ! // return bundle; ! return null; ! } /** Index: ResourceBundleFinderImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusCommons/src/java/org/openbus/commons/i18n/ResourceBundleFinderImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ResourceBundleFinderImpl.java 27 May 2005 00:20:27 -0000 1.2 --- ResourceBundleFinderImpl.java 26 Jun 2005 22:35:56 -0000 1.3 *************** *** 77,81 **** for (int n=0; n < mappingList.size(); n++) { String mapKey = new String(key); ! mapKey = mapKey.substring(0, "{0}"); String javaPattern = config.getString(mapKey --- 77,81 ---- for (int n=0; n < mappingList.size(); n++) { String mapKey = new String(key); ! // mapKey = mapKey.substring(0, "{0}"); String javaPattern = config.getString(mapKey |
|
From: Diego E. <er...@us...> - 2005-06-25 22:25:27
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/messaging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29989/src/java/org/openbus/jbi/messaging Modified Files: DeliveryChannelImpl.java Log Message: Index: DeliveryChannelImpl.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/messaging/DeliveryChannelImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DeliveryChannelImpl.java 21 Jun 2005 03:12:19 -0000 1.10 --- DeliveryChannelImpl.java 25 Jun 2005 22:25:16 -0000 1.11 *************** *** 33,37 **** public class DeliveryChannelImpl implements DeliveryChannel { ! private static Log log = LogFactory.getLog(DeliveryChannelImplTest.class); /** --- 33,37 ---- public class DeliveryChannelImpl implements DeliveryChannel { ! private static Log log = LogFactory.getLog(DeliveryChannelImpl.class); /** |
|
From: Esteban S. <es...@us...> - 2005-06-24 15:34:06
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24925/src/test/org/openbus/jbi/loader Added Files: CompositeClassLoaderTest.java other_pack.jar class_loader_test.jar DelegateClassLoaderTest.java Log Message: Adding custom class loaders --- NEW FILE: CompositeClassLoaderTest.java --- /* * Copyright 2001-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. */ package org.openbus.jbi.loader; import java.net.URL; import junit.framework.TestCase; /** * * * @author <a href="mailto:es...@op...">Esteban Sancho</a> */ public class CompositeClassLoaderTest extends TestCase { /* * Class under test for Class loadClass(String) */ public void testLoadClass() { URL[] path1 = new URL[1]; path1[0] = getClass().getResource("class_loader_test.jar"); DelegateClassLoader cl1 = new DelegateClassLoader(path1, getClass() .getClassLoader(), false); URL[] path2 = new URL[1]; path2[0] = getClass().getResource("other_pack.jar"); DelegateClassLoader cl2 = new DelegateClassLoader(path2, getClass() .getClassLoader(), false); CompositeClassLoader composite = new CompositeClassLoader(ClassLoader.getSystemClassLoader()); composite.addClassLoader(cl1); composite.addClassLoader(cl2); try { composite.loadClass("clazz.loader.test.Class1"); composite.loadClass("other.pack.Class2"); } catch (ClassNotFoundException e) { assertFalse("Class wasn't found: " + e.getLocalizedMessage(), true); } } } --- NEW FILE: DelegateClassLoaderTest.java --- /* * Copyright 2001-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. */ package org.openbus.jbi.loader; import java.net.URL; import junit.framework.TestCase; /** * * * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ public class DelegateClassLoaderTest extends TestCase { /* * Class under test for Class loadClass(String, boolean) */ public void testSimpleLoadClass() { URL[] path = new URL[1]; path[0] = getClass().getResource("class_loader_test.jar"); DelegateClassLoader cl1 = new DelegateClassLoader(path, getClass() .getClassLoader(), true); DelegateClassLoader cl2 = new DelegateClassLoader(path, getClass() .getClassLoader(), false); try { cl1.loadClass("clazz.loader.test.Class1"); cl2.loadClass("clazz.loader.test.Class1"); } catch (ClassNotFoundException e) { assertFalse("Class wasn't found: " + e.getLocalizedMessage(), true); } } public void testIsSystemClass() { URL[] path = new URL[1]; path[0] = getClass().getResource("class_loader_test.jar"); DelegateClassLoader cl = new DelegateClassLoader(path, true); assertTrue(cl.isSystemClass("java.lang.Object")); assertTrue(cl.isSystemClass("javax.lang.Object")); assertFalse(cl.isSystemClass("javaxa.lang.Object")); assertFalse(cl.isSystemClass("org.openbus.Fruta")); } } --- NEW FILE: other_pack.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: class_loader_test.jar --- (This appears to be a binary file; contents omitted.) |
|
From: Esteban S. <es...@us...> - 2005-06-24 15:34:06
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24925 Modified Files: project.xml .classpath Log Message: Adding custom class loaders Index: .classpath =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/.classpath,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .classpath 9 Jun 2005 00:42:58 -0000 1.5 --- .classpath 24 Jun 2005 15:33:54 -0000 1.6 *************** *** 12,15 **** --- 12,19 ---- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/hivemind/jars/hivemind-1.0.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/hivemind/jars/hivemind-lib-1.0.jar"> + </classpathentry> <classpathentry kind="src" path="/commons"> </classpathentry> Index: project.xml =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/project.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** project.xml 16 Jun 2005 03:35:37 -0000 1.9 --- project.xml 24 Jun 2005 15:33:54 -0000 1.10 *************** *** 64,67 **** --- 64,77 ---- <!-- jar files the project is dependent on --> <dependencies> + <dependency> + <groupId>hivemind</groupId> + <artifactId>hivemind</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>hivemind</groupId> + <artifactId>hivemind-lib</artifactId> + <version>1.0</version> + </dependency> <dependency> <groupId>openbus</groupId> |
|
From: Esteban S. <es...@us...> - 2005-06-24 15:34:04
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24925/src/java/org/openbus/jbi/loader Added Files: CompositeClassLoader.java DelegateClassLoader.java Log Message: Adding custom class loaders --- NEW FILE: DelegateClassLoader.java --- /* * Copyright 2001-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. */ package org.openbus.jbi.loader; import java.net.URL; import java.net.URLClassLoader; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * ClassLoader with a configurable delegation model * * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ public class DelegateClassLoader extends URLClassLoader { private static final Log log = LogFactory.getLog(DelegateClassLoader.class); private boolean parentFirst; public DelegateClassLoader(URL[] urls_, boolean parentFirst_) { super(urls_); parentFirst = parentFirst_; } public DelegateClassLoader(URL[] urls_, ClassLoader parent_, boolean parentFirst_) { super(urls_, parent_); parentFirst = parentFirst_; } public synchronized Class loadClass(String name_, boolean resolve_) throws ClassNotFoundException { if (parentFirst || isSystemClass(name_)) { // default Java 2 implementation if (log.isDebugEnabled()) { log.debug("Delegating resolution of class " + name_ + " to the parent first"); } return super.loadClass(name_, resolve_); } else { // our custom implementation for resolving self first if (log.isDebugEnabled()) { log.debug("Trying to resolve class " + name_ + " here first"); } return selfFirstLoadClass(name_, resolve_); } } protected boolean isSystemClass(String name_) { boolean isSystem = (name_.startsWith("java.")) || (name_.startsWith("javax.")); if (log.isDebugEnabled()) { log.debug("Class " + name_ + (isSystem ? " is " : " is not ") + "a system class"); } return isSystem; } protected Class selfFirstLoadClass(String name_, boolean resolve_) throws ClassNotFoundException { // First check if the class is already loaded Class clazz = findLoadedClass(name_); if (clazz == null) { try { // first look here clazz = findClass(name_); if (log.isDebugEnabled()) { log.debug("Class " + name_ + " resolved here"); } } catch (ClassNotFoundException e) { // If still not found, then delegate to the parent if (getParent() != null) { clazz = getParent().loadClass(name_); if (log.isDebugEnabled()) { log.debug("Class " + name_ + " resolved in parent"); } // returning in order to don't resolve it again return clazz; } } } if (resolve_) { resolveClass(clazz); } return clazz; } } --- NEW FILE: CompositeClassLoader.java --- /* * Copyright 2001-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. */ package org.openbus.jbi.loader; import java.security.SecureClassLoader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * * @author <a href="mailto:es...@op...">Esteban Sancho </a> */ public class CompositeClassLoader extends SecureClassLoader { private static final Log log = LogFactory .getLog(CompositeClassLoader.class); private Collection classLoaders; public CompositeClassLoader(ClassLoader parent_) { super(parent_); classLoaders = new ArrayList(); } public CompositeClassLoader(ClassLoader parent_, DelegateClassLoader[] classLoaders_) { super(parent_); classLoaders = Arrays.asList(classLoaders_); } public void addClassLoader(DelegateClassLoader loader_) { if (log.isDebugEnabled()) { log.debug("Adding class loader " + loader_); } classLoaders.add(loader_); } public void removeClassLoader(DelegateClassLoader loader_) { boolean removed = classLoaders.remove(loader_); if (log.isDebugEnabled()) { log.debug("Removing class loader " + loader_ + " - Found: " + removed); } } public Class loadClass(String name_) throws ClassNotFoundException { return loadClass(name_, true); } protected synchronized Class loadClass(String name_, boolean resolve_) throws ClassNotFoundException { // look into the cache Class clazz = findLoadedClass(name_); if (clazz != null) { if (log.isDebugEnabled()) { log.debug("Class " + name_ + " was already loaded"); } return clazz; } // look into the backend class-loaders for (Iterator i = classLoaders.iterator(); i.hasNext();) { DelegateClassLoader loader = (DelegateClassLoader) i.next(); try { clazz = loader.loadClass(name_, resolve_); if (log.isDebugEnabled()) { log.debug("Class " + name_ + " found in class loader: " + loader); } return clazz; } catch (ClassNotFoundException e) { if (log.isTraceEnabled()) { log.trace("Class " + name_ + " not found in class loader: " + loader); } } } if (log.isDebugEnabled()) { log.debug("Class not found: " + name_); } // @todo i18n throw new ClassNotFoundException("Class not found: " + name_); } } |
|
From: Esteban S. <es...@us...> - 2005-06-24 15:33:58
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24841/src/java/org/openbus/jbi/loader Log Message: Directory /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/loader added to the repository |
|
From: Esteban S. <es...@us...> - 2005-06-24 15:33:58
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24841/src/test/org/openbus/jbi/loader Log Message: Directory /cvsroot/openbus/Openbus/OpenbusJBI/src/test/org/openbus/jbi/loader added to the repository |