|
From: <to...@us...> - 2008-01-07 22:24:02
|
Revision: 97
http://xoperator.svn.sourceforge.net/xoperator/?rev=97&view=rev
Author: tomatop
Date: 2008-01-07 14:23:40 -0800 (Mon, 07 Jan 2008)
Log Message:
-----------
group agent
Modified Paths:
--------------
trunk/xOperator/src/net/sf/xoperator/blackboard/ThreadsafeObjectBlackboard.java
trunk/xOperator/src/net/sf/xoperator/configuration/SerialisingPersister.java
trunk/xOperator/src/net/sf/xoperator/startup/CommandLineMain.java
trunk/xOperator/src/net/sf/xoperator/xmpp/AccountInfo.java
trunk/xOperator/src/net/sf/xoperator/xmpp/XMPPManager.java
Modified: trunk/xOperator/src/net/sf/xoperator/blackboard/ThreadsafeObjectBlackboard.java
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/blackboard/ThreadsafeObjectBlackboard.java 2008-01-06 19:19:16 UTC (rev 96)
+++ trunk/xOperator/src/net/sf/xoperator/blackboard/ThreadsafeObjectBlackboard.java 2008-01-07 22:23:40 UTC (rev 97)
@@ -86,7 +86,7 @@
this.notifyEntryAdded(zone, clonedEntry);
} catch (Throwable e) {
this.log.error("Throwable caught: " + e);
- throw new RuntimeException(e);
+ //throw new RuntimeException(e);
}
}
Modified: trunk/xOperator/src/net/sf/xoperator/configuration/SerialisingPersister.java
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/configuration/SerialisingPersister.java 2008-01-06 19:19:16 UTC (rev 96)
+++ trunk/xOperator/src/net/sf/xoperator/configuration/SerialisingPersister.java 2008-01-07 22:23:40 UTC (rev 97)
@@ -176,7 +176,7 @@
}
// same with the proxy
- if (proxy.validate()) {
+ if (proxy!=null && proxy.validate()) {
configs.put(AccountInfo.class.getCanonicalName()
+ AccountInfo.PROXY, proxy);
}
Modified: trunk/xOperator/src/net/sf/xoperator/startup/CommandLineMain.java
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/startup/CommandLineMain.java 2008-01-06 19:19:16 UTC (rev 96)
+++ trunk/xOperator/src/net/sf/xoperator/startup/CommandLineMain.java 2008-01-07 22:23:40 UTC (rev 97)
@@ -131,6 +131,22 @@
.withDescription(
"The port of the server to connect to for the roxy account, defaults to 5222")
.create("proxy_port"));
+ options
+ .addOption(OptionBuilder
+ .withArgName("group_agent")
+ .hasArg()
+ .isRequired(false)
+ .withDescription(
+ "if set to to true, no proxy account will be used")
+ .create("group_agent"));
+ options
+ .addOption(OptionBuilder
+ .withArgName("p2penabled")
+ .hasArg()
+ .isRequired(false)
+ .withDescription(
+ "if set to to true, p2p communication is activated")
+ .create("p2penabled"));
}
@@ -144,7 +160,6 @@
CommandLineParser parser = new GnuParser();
AccountInfo main = new AccountInfo();
AccountInfo proxy = new AccountInfo();
- List<RdfStoreInfo> stores = new ArrayList<RdfStoreInfo>();
try {
CommandLine cl = parser.parse(options, args);
@@ -152,14 +167,21 @@
main.setPassword(cl.getOptionValue("main_password"));
main.setServer(cl.getOptionValue("main_server"));
main.setPort(cl.getOptionValue("main_port")!=null?Integer.parseInt(cl.getOptionValue("main_port")):null);
+
+ main.setStandalone(cl.getOptionValue("group_agent")!=null?Boolean.parseBoolean(cl.getOptionValue("group_agent")):false);
+ main.setP2penabled(cl.getOptionValue("p2penabled")!=null?Boolean.getBoolean(cl.getOptionValue("p2penabled")):false);
main.setMainAccount(true);
+ if(main.isStandalone()){
+ proxy=null;
+ }else{
+ proxy.setUsername(cl.getOptionValue("proxy_username"));
+ proxy.setPassword(cl.getOptionValue("proxy_password"));
+ proxy.setServer(cl.getOptionValue("proxy_server"));
+ proxy.setPort(cl.getOptionValue("proxy_port")!=null?Integer.parseInt(cl.getOptionValue("proxy_port")):null);
+ proxy.setMainAccount(false);
+ }
- proxy.setUsername(cl.getOptionValue("proxy_username"));
- proxy.setPassword(cl.getOptionValue("proxy_password"));
- proxy.setServer(cl.getOptionValue("proxy_server"));
- proxy.setPort(cl.getOptionValue("proxy_port")!=null?Integer.parseInt(cl.getOptionValue("proxy_port")):null);
- proxy.setMainAccount(false);
Modified: trunk/xOperator/src/net/sf/xoperator/xmpp/AccountInfo.java
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/xmpp/AccountInfo.java 2008-01-06 19:19:16 UTC (rev 96)
+++ trunk/xOperator/src/net/sf/xoperator/xmpp/AccountInfo.java 2008-01-07 22:23:40 UTC (rev 97)
@@ -27,6 +27,7 @@
*
*/
public class AccountInfo extends PersistentKSConfiguration {
+
public static final String MAIN = "main";
@@ -45,6 +46,26 @@
private boolean mainAccount;
private boolean obsolete;
+
+ private boolean standalone = false;
+
+ private boolean p2penabled = false;
+
+ public void setP2penabled(boolean p2penabled) {
+ this.p2penabled = p2penabled;
+ }
+
+ public boolean isP2penabled() {
+ return p2penabled;
+ }
+
+ public void setStandalone(boolean standalone) {
+ this.standalone = standalone;
+ }
+
+ public boolean isStandalone() {
+ return standalone;
+ }
@Override
public boolean isObsolete() {
Modified: trunk/xOperator/src/net/sf/xoperator/xmpp/XMPPManager.java
===================================================================
--- trunk/xOperator/src/net/sf/xoperator/xmpp/XMPPManager.java 2008-01-06 19:19:16 UTC (rev 96)
+++ trunk/xOperator/src/net/sf/xoperator/xmpp/XMPPManager.java 2008-01-07 22:23:40 UTC (rev 97)
@@ -71,7 +71,14 @@
this.log.error(e);
throw new RuntimeException(e);
}
- registerInterAgentCommunicationListener(mainClient);
+ if(info.isStandalone()){
+ registerChatListeners(mainClient);
+ }
+
+ if(info.isP2penabled()){
+ registerInterAgentCommunicationListener(mainClient);
+ }
+
}
private void logIntoProxy(AccountInfo info) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|