Permalink
Browse files

Remove MessageDescriptor interfac

  • Loading branch information...
dgomezferro committed May 31, 2012
1 parent 6415f0b commit b7887b23dba93c03bcee8e286bde330ddbf059ba
@@ -17,14 +17,9 @@
package com.yahoo.pasc.paxos.client;
import com.yahoo.pasc.Message;
-import com.yahoo.pasc.MessageDescriptor;
public class Connected extends Message {
- public static class Descriptor implements MessageDescriptor {
-
- }
-
@Override
protected boolean verify() {
return true;
@@ -25,28 +25,28 @@
import com.yahoo.pasc.paxos.client.Connected;
import com.yahoo.pasc.paxos.messages.Hello;
-public class HelloHandler implements MessageHandler<Hello, ClientState, Connected.Descriptor> {
+public class HelloHandler implements MessageHandler<Hello, ClientState, Connected> {
@Override
public boolean guardPredicate(Hello receivedMessage) {
return true;
}
@Override
- public List<Connected.Descriptor> processMessage(Hello hello, ClientState state) {
- List<Connected.Descriptor> descriptors = null;
+ public List<Connected> processMessage(Hello hello, ClientState state) {
+ List<Connected> descriptors = null;
int connected = state.getConnected();
connected++;
state.setConnected(connected);
if (connected == state.getServers()) {
// Send the first message if connected to all servers
- descriptors = Arrays.asList(new Connected.Descriptor());
+ descriptors = Arrays.asList(new Connected());
}
return descriptors;
}
@Override
- public List<Message> getSendMessages(ClientState state, List<Connected.Descriptor> descriptors) {
+ public List<Message> getSendMessages(ClientState state, List<Connected> descriptors) {
if (descriptors != null && descriptors.size() > 0) {
return Arrays.<Message> asList(new Connected());
}
@@ -17,11 +17,10 @@
package com.yahoo.pasc.paxos.client.messages;
import com.yahoo.pasc.Message;
-import com.yahoo.pasc.MessageDescriptor;
public class Received extends Message {
- public static class Descriptor implements MessageDescriptor {
+ public static class Descriptor {
private byte[] value;
@@ -17,11 +17,10 @@
package com.yahoo.pasc.paxos.client.messages;
import com.yahoo.pasc.Message;
-import com.yahoo.pasc.MessageDescriptor;
public class Submit extends Message {
- public static class Descriptor implements MessageDescriptor {
+ public static class Descriptor {
private byte[] value;
@@ -18,9 +18,8 @@
import java.util.List;
-import com.yahoo.pasc.MessageDescriptor;
import com.yahoo.pasc.paxos.state.PaxosState;
-public interface PaxosDescriptor extends MessageDescriptor {
+public interface PaxosDescriptor {
public List<PaxosMessage> buildMessages(PaxosState state);
}
@@ -21,9 +21,8 @@
import com.yahoo.pasc.CloneableDeep;
import com.yahoo.pasc.EqualsDeep;
-import com.yahoo.pasc.MessageDescriptor;
-public class Request extends PaxosMessage implements Serializable, EqualsDeep<Request>, CloneableDeep<Request>, MessageDescriptor {
+public class Request extends PaxosMessage implements Serializable, EqualsDeep<Request>, CloneableDeep<Request> {
private static final long serialVersionUID = 1111659280353033430L;

0 comments on commit b7887b2

Please sign in to comment.