You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by th...@apache.org on 2008/06/11 11:28:12 UTC
svn commit: r666589 -
/labs/droids/trunk/src/core/java/org/apache/droids/Core.java
Author: thorsten
Date: Wed Jun 11 02:28:11 2008
New Revision: 666589
URL: http://svn.apache.org/viewvc?rev=666589&view=rev
Log:
Adding more java documentation and fixing code regarding the output from an Enerjy Code Analysis. Further adding missing license headers.
Modified:
labs/droids/trunk/src/core/java/org/apache/droids/Core.java
Modified: labs/droids/trunk/src/core/java/org/apache/droids/Core.java
URL: http://svn.apache.org/viewvc/labs/droids/trunk/src/core/java/org/apache/droids/Core.java?rev=666589&r1=666588&r2=666589&view=diff
==============================================================================
--- labs/droids/trunk/src/core/java/org/apache/droids/Core.java (original)
+++ labs/droids/trunk/src/core/java/org/apache/droids/Core.java Wed Jun 11 02:28:11 2008
@@ -23,65 +23,146 @@
import org.apache.droids.helper.factories.ProtocolFactory;
import org.apache.droids.helper.factories.URLFiltersFactory;
+/**
+ * Core configuration mainly holding the different factories we are using.
+ *
+ * @author thorsten
+ * @version 1.0
+ *
+ */
public class Core {
- private DroidFactory droids;
+ private DroidFactory droids=null;
+ /**
+ * Set the droidsFactory we are using.
+ * This is the core component that knows all registered droids
+ * that the application offers.
+ * @param droids
+ * @see DroidFactory
+ */
public void setDroids(DroidFactory droids) {
this.droids = droids;
}
+ /**
+ * Return the droid we want to use identified
+ * by the given name. Will contact the droidsFactory
+ * and looks up the droid.
+ * @param name the name of the droid we want to use
+ * @return The droid that is identified by the name
+ * @see DroidFactory
+ */
public Droid getDroid(String name) {
return droids.getDroid(name);
}
- private ParserFactory parserFactory;
+ private ParserFactory parserFactory=null;
- private ProtocolFactory protocolFactory;
+ private ProtocolFactory protocolFactory=null;
- private URLFiltersFactory filtersFactory;
+ private URLFiltersFactory filtersFactory=null;
- private HandlerFactory handlerFactory;
+ private HandlerFactory handlerFactory=null;
+ /**
+ * Returns the protocolFactory that knows all registered
+ * protocol.
+ * @return protocolFactory that knows all registered
+ * protocol.
+ * @see ProtocolFactory
+ */
public ProtocolFactory getProtocolFactory() {
return protocolFactory;
}
+ /**
+ * Set the pre-configured protocolFactory that knows all registered
+ * protocol.
+ * @param protocolFactory pre-configured protocolFactory
+ * @see ProtocolFactory
+ */
public void setProtocolFactory(ProtocolFactory protocolFactory) {
this.protocolFactory = protocolFactory;
}
- public void start(String name) throws InterruptedException {
+ /**
+ * Start a given Droid. First we will look up the droid
+ * identified by the given name and then start it.
+ * @param name the name of the droid we want to use
+ */
+ public void start(String name){
Droid droid = getDroid(name);
droid.run();
}
// Display a message, preceded by the name of the current thread
+ /**
+ * Since we are using for now exclusively the command line, the
+ * method should be use to send message to the user.
+ * @param message the message you want to send
+ */
public static void threadMessage(String message) {
String threadName = Thread.currentThread().getName();
System.out.format("%s: %s%n", threadName, message);
}
+ /**
+ * Returns the parserFactory that knows all registered
+ * parser.
+ * @return parserFactory that knows all registered
+ * parser.
+ * @see ParserFactory
+ */
public ParserFactory getParserFactory() {
return parserFactory;
}
+ /**
+ * Set the pre-configured parserFactory that knows all registered
+ * parser.
+ * @param parserFactory pre-configured parserFactory
+ * @see ParserFactory
+ */
public void setParserFactory(ParserFactory parserFactory) {
this.parserFactory = parserFactory;
}
+ /**
+ * Returns the filtersFactory that knows all registered
+ * filters.
+ * @return filtersFactory that knows all registered
+ * filters.
+ * @see URLFiltersFactory
+ */
public URLFiltersFactory getFiltersFactory() {
return filtersFactory;
}
+ /**
+ * Set the pre-configured filtersFactory that knows all registered filters.
+ * @param filtersFactory filtersFactory that knows all registered
+ * filters.
+ * @see URLFiltersFactory
+ */
public void setFiltersFactory(URLFiltersFactory filtersFactory) {
this.filtersFactory = filtersFactory;
}
+ /**
+ * Returns the handlerFactory that knows all registered handlers.
+ * @return handlerFactory that knows all registered handlers.
+ * @see HandlerFactory
+ */
public HandlerFactory getHandlerFactory() {
return handlerFactory;
}
+ /**
+ * Set the pre-configured handlerFactory that knows all registered handlers.
+ * @param handlerFactory pre-configured handlerFactory that knows all registered handlers.
+ * @see HandlerFactory
+ */
public void setHandlerFactory(HandlerFactory handlerFactory) {
this.handlerFactory = handlerFactory;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org