CVS update: JGroups/src/org/jgroups JChannel.java
"Bela Ban" <[email protected]> Wed, 6 Oct 2010 09:46:24 +0000
| Newsgroups | gmane.comp.java.javagroups.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: belaban
Date: 10/10/06 09:46:24
Modified: src/org/jgroups JChannel.java
Log:
first impl of programmatic API (https://jira.jboss.org/browse/JGRP-1245)
Revision Changes Path
1.249 +24 -10 JGroups/src/org/jgroups/JChannel.java
Index: JChannel.java
===================================================================
RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/JChannel.java,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -r1.248 -r1.249
--- JChannel.java 17 Sep 2010 11:54:47 -0000 1.248
+++ JChannel.java 6 Oct 2010 09:46:24 -0000 1.249
@@ -81,7 +81,7 @@
* the construction of the stack will be aborted.
*
* @author Bela Ban
- * @version $Id: JChannel.java,v 1.248 2010/09/17 11:54:47 belaban Exp $
+ * @version $Id: JChannel.java,v 1.249 2010/10/06 09:46:24 belaban Exp $
*/
@MBean(description="JGroups channel")
public class JChannel extends Channel {
@@ -149,12 +149,19 @@
/**
- * Used by subclass to create a JChannel without a protocol stack, don't use as application programmer
- * @deprecated Remove in 3.0
+ * Creates a JChannel without a protocol stack; used for programmatic creation of channel and protocol stack
+ * @param create_protocol_stack If true, tthe default configuration will be used. If false, no protocol stack
+ * will be created
*/
-
- protected JChannel(boolean no_op) {
- ;
+ public JChannel(boolean create_protocol_stack) {
+ if(create_protocol_stack) {
+ try {
+ init(ConfiguratorFactory.getStackConfigurator(DEFAULT_PROTOCOL_STACK));
+ }
+ catch(ChannelException e) {
+ throw new RuntimeException(e);
+ }
+ }
}
/**
@@ -288,17 +295,24 @@
receive_local_msgs=ch.receive_local_msgs;
}
+ public ProtocolStack createProtocolStack() {
+ prot_stack=new ProtocolStack();
+ prot_stack.setChannel(this);
+ return prot_stack;
+ }
+
/**
- * Returns the protocol stack.
- * Currently used by Debugger.
- * Specific to JChannel, therefore
- * not visible in Channel
+ * Returns the protocol stack
*/
public ProtocolStack getProtocolStack() {
return prot_stack;
}
+ public void setProtocolStack(ProtocolStack stack) {
+ this.prot_stack=stack;
+ }
+
protected Log getLog() {
return log;
}
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb