Skip to content

Commit

Permalink
removed ProtocolStackFactory interface
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Sep 16, 2010
1 parent f135b05 commit 3a39c01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 2 additions & 3 deletions src/org/jgroups/stack/Configurator.java
Expand Up @@ -10,7 +10,6 @@
import org.jgroups.logging.Log;
import org.jgroups.logging.LogFactory;
import org.jgroups.protocols.TP;
import org.jgroups.stack.ProtocolStack.ProtocolStackFactory;
import org.jgroups.util.StackType;
import org.jgroups.util.Tuple;
import org.jgroups.util.Util;
Expand All @@ -37,9 +36,9 @@
* of the protocol stack and the properties of each layer.
* @author Bela Ban
* @author Richard Achmatowicz
* @version $Id: Configurator.java,v 1.86 2010/09/16 15:32:23 belaban Exp $
* @version $Id: Configurator.java,v 1.87 2010/09/16 15:51:18 belaban Exp $
*/
public class Configurator implements ProtocolStackFactory {
public class Configurator {
protected static final Log log=LogFactory.getLog(Configurator.class);
private final ProtocolStack stack;

Expand Down
14 changes: 3 additions & 11 deletions src/org/jgroups/stack/ProtocolStack.java
Expand Up @@ -30,7 +30,7 @@
* stacks, and to destroy them again when not needed anymore
*
* @author Bela Ban
* @version $Id: ProtocolStack.java,v 1.107 2010/09/16 15:46:54 belaban Exp $
* @version $Id: ProtocolStack.java,v 1.108 2010/09/16 15:51:18 belaban Exp $
*/
public class ProtocolStack extends Protocol implements Transport {
public static final int ABOVE = 1; // used by insertProtocol()
Expand Down Expand Up @@ -453,7 +453,7 @@ private static Map<String,String> getProps(Protocol prot) {

public void setup(List<ProtocolConfiguration> configs) throws Exception {
if(top_prot == null) {
top_prot=getProtocolStackFactory().setupProtocolStack(configs);
top_prot=new Configurator(this).setupProtocolStack(configs);
top_prot.setUpProtocol(this);
this.setDownProtocol(top_prot);
bottom_prot=getBottomProtocol();
Expand All @@ -462,15 +462,11 @@ public void setup(List<ProtocolConfiguration> configs) throws Exception {
}


protected ProtocolStackFactory getProtocolStackFactory() {
return new Configurator(this);
}



public void setup(ProtocolStack stack) throws Exception {
if(top_prot == null) {
top_prot=getProtocolStackFactory().setupProtocolStack(stack);
top_prot=new Configurator(this).setupProtocolStack(stack);
top_prot.setUpProtocol(this);
this.setDownProtocol(top_prot);
bottom_prot=getBottomProtocol();
Expand Down Expand Up @@ -947,9 +943,5 @@ public String toString() {
}
}

public interface ProtocolStackFactory{
public Protocol setupProtocolStack(List<ProtocolConfiguration> cfg) throws Exception;
public Protocol setupProtocolStack(ProtocolStack copySource) throws Exception;
}

}

0 comments on commit 3a39c01

Please sign in to comment.