You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by ru...@apache.org on 2007/09/24 10:28:56 UTC
svn commit: r578704 - in
/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup:
Job.java jobs/MessageInjector.java
Author: ruwan
Date: Mon Sep 24 01:28:55 2007
New Revision: 578704
URL: http://svn.apache.org/viewvc?rev=578704&view=rev
Log:
Adding comments to the Job interface and to the MessageInjectore (Job impl)
Modified:
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/Job.java
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/jobs/MessageInjector.java
Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/Job.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/Job.java?rev=578704&r1=578703&r2=578704&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/Job.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/Job.java Mon Sep 24 01:28:55 2007
@@ -1,5 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.synapse.startup;
+/**
+ * Defines the Job for a SimpleQuarts Startup
+ */
public interface Job {
- public void execute();
+
+ /**
+ * Esecute method will be invoked by the SimpleQuartzStartup
+ */
+ public void execute();
}
Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/jobs/MessageInjector.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/jobs/MessageInjector.java?rev=578704&r1=578703&r2=578704&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/jobs/MessageInjector.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/startup/jobs/MessageInjector.java Mon Sep 24 01:28:55 2007
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.synapse.startup.jobs;
import org.apache.axiom.om.OMElement;
@@ -10,29 +29,67 @@
import org.apache.synapse.startup.Job;
import org.apache.synapse.util.PayloadHelper;
+/**
+ * Injects a Message in to the Synapse environment
+ */
public class MessageInjector implements Job, ManagedLifecycle {
- private Log log = LogFactory.getLog(MessageInjector.class);
-
- private OMElement message;
-
- String to;
-
- private SynapseEnvironment synapseEnvironment;
- public void init(SynapseEnvironment se) {
+ /**
+ * Holds the logger for logging purposes
+ */
+ private Log log = LogFactory.getLog(MessageInjector.class);
+
+ /**
+ * Holds the Message to be injected
+ */
+ private OMElement message = null;
+
+ /**
+ * Holds the to address for the message to be injected
+ */
+ private String to = null;
+
+ /**
+ * Holds the SynapseEnv to which the message will be injected
+ */
+ private SynapseEnvironment synapseEnvironment;
+
+ /**
+ * Initializes the Injector
+ *
+ * @param se
+ * SynapseEnvironment of synapse
+ */
+ public void init(SynapseEnvironment se) {
synapseEnvironment = se;
}
- public void setMessage(OMElement el) {
- log.debug("set message " + el.toString());
- message = el;
+ /**
+ * Set the message to be injected
+ *
+ * @param elem
+ * OMElement describing the message
+ */
+ public void setMessage(OMElement elem) {
+ log.debug("set message " + elem.toString());
+ message = elem;
}
- public void setTo(String url) {
+ /**
+ * Set the to address of the message to be injected
+ *
+ * @param url
+ * String containing the to address
+ */
+ public void setTo(String url) {
to = url;
}
- public void execute() {
+ /**
+ * This will be invoked by the schedular to inject the message
+ * in to the SynapseEnvironment
+ */
+ public void execute() {
log.debug("execute");
if (synapseEnvironment == null) {
log.error("Synapse Environment not set");
@@ -55,7 +112,10 @@
}
- public void destroy() {
+ /**
+ * Destroys the Injector
+ */
+ public void destroy() {
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org