[jboss-svn-commits] JBL Code SVN: r23341 - labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 7 02:32:35 EDT 2008
Author: beve
Date: 2008-10-07 02:32:35 -0400 (Tue, 07 Oct 2008)
New Revision: 23341
Modified:
labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/HelloworldActivator.java
labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/MyTestService.java
Log:
Checkstyle cleanup
Modified: labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/HelloworldActivator.java
===================================================================
--- labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/HelloworldActivator.java 2008-10-07 06:26:29 UTC (rev 23340)
+++ labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/HelloworldActivator.java 2008-10-07 06:32:35 UTC (rev 23341)
@@ -39,15 +39,30 @@
*/
public class HelloworldActivator implements BundleActivator
{
+ /**
+ * The ESB Deployment Runtime.
+ */
private DeploymentRuntime runtime;
- public void start(BundleContext context) throws Exception
+ /**
+ * Bundle start method. Deploys the ESB configuration.
+ *
+ * @param context - the OSGi BundleContext
+ * @throws Exception - is an exception occurs.
+ */
+ public final void start(final BundleContext context) throws Exception
{
runtime = DeploymentUtil.createRuntime(getConfiguration("/jboss-esb.xml"));
runtime.deploy();
}
- public void stop(BundleContext context) throws Exception
+ /**
+ * Bundle stop method. Deploys the ESB configuration.
+ *
+ * @param context - the OSGi BundleContext
+ * @throws Exception - is an exception occurs.
+ */
+ public final void stop(final BundleContext context) throws Exception
{
if (runtime != null)
{
@@ -55,6 +70,12 @@
}
}
+ /**
+ * Retrieves the esb confuration file as an InputStream.
+ *
+ * @param fileName - the configuration file.
+ * @return InputStream - inputstream to the configuration file.
+ */
private InputStream getConfiguration(final String fileName)
{
InputStream in = getClass().getResourceAsStream(fileName);
Modified: labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/MyTestService.java
===================================================================
--- labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/MyTestService.java 2008-10-07 06:26:29 UTC (rev 23340)
+++ labs/jbossesb/workspace/skeagh/examples/helloworld/src/main/java/org/jboss/esb/examples/helloworld/MyTestService.java 2008-10-07 06:32:35 UTC (rev 23341)
@@ -24,26 +24,39 @@
import org.jboss.esb.service.ServiceException;
/**
- * Simple Test service
+ * Simple Test service.
*
* @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
*/
public class MyTestService implements Service
{
+ /**
+ * ESB Message object. Only used for testing.
+ */
private static Message message;
- public Message process(Message message) throws ServiceException
+ /**
+ * Processes the message.
+ * @param msg - the esb message object instance.
+ * @return Messsage - the esb message object instance.
+ * @throws ServiceException - if an exception occurs during processing.
+ */
+ public final Message process(final Message msg) throws ServiceException
{
- System.out.println("MyTestService message payload : " + message.getPayload());
- MyTestService.message = message;
- return message;
+ System.out.println("MyTestService message payload : " + msg.getPayload());
+ MyTestService.message = msg;
+ return msg;
}
+ /**
+ * Simple get the static message object instance.
+ * This is only intended for unit testing.
+ *
+ * @return Message - the ESB Message object that was last seen by the process method.
+ */
public static Message getMessage()
{
return message;
}
-
-
}
More information about the jboss-svn-commits
mailing list