Skip to content

Commit

Permalink
Reafactor InfrastructureLoopback code
Browse files Browse the repository at this point in the history
  • Loading branch information
vladamatena committed Mar 11, 2015
1 parent 2a51190 commit dd1af80
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public boolean canSend(Address address) {

@Override
public void send(byte[] data, Address destination) {
if(!(destination instanceof IPAddress)) {
throw new UnsupportedOperationException("Required destination address is not IPAddress");
}
IPAddress ipAddress = (IPAddress) (destination);
InfrastructureLoopback.this.route(data, this, ipAddress);
}
Expand Down Expand Up @@ -83,7 +86,7 @@ public void route(byte[] data, LoopDevice source, IPAddress destination) {
@Override
public List<Class<? extends DEECoPlugin>> getDependencies() {
return Arrays.asList(Network.class);
}
}

@Override
public void init(DEECoContainer container) {
Expand Down

0 comments on commit dd1af80

Please sign in to comment.