You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by db...@apache.org on 2005/11/18 09:56:17 UTC
svn commit: r345473 -
/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
Author: dblevins
Date: Fri Nov 18 00:56:13 2005
New Revision: 345473
URL: http://svn.apache.org/viewcvs?rev=345473&view=rev
Log:
Encapsulated usage of Client
Modified:
geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java?rev=345473&r1=345472&r2=345473&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java Fri Nov 18 00:56:13 2005
@@ -48,10 +48,11 @@
private Connection connection;
private Client client;
+
public synchronized void start() throws StartingException {
try {
- client = new Client(coordinatorUrl);
- connection = client.getConnection();
+ setClient(new Client(coordinatorUrl));
+ connection = getClient().getConnection();
} catch (Throwable e) {
getLogger().error("Could not create connection to: "+coordinatorUrl, e);
throw new StartingException("Could not create connection to: "+coordinatorUrl);
@@ -66,7 +67,7 @@
public synchronized void stop() throws StoppingException {
run = false;
try {
- client.close();
+ getClient().close();
} catch (JMSException e) {
getLogger().error("Could not close connection to: "+coordinatorUrl, e);
throw new StoppingException("Could not close connection to: "+coordinatorUrl);
@@ -130,11 +131,19 @@
}
public synchronized Connection getConnection() throws JMSException {
- return client.getConnection();
+ return getClient().getConnection();
}
public synchronized Session getSession() throws JMSException {
- return client.getSession();
+ return getClient().getSession();
+ }
+
+ public synchronized Client getClient() {
+ return client;
+ }
+
+ public synchronized void setClient(Client client) {
+ this.client = client;
}
public static class Client {