Created
February 18, 2014 08:08
-
-
Save bjpeterdelacruz/9066602 to your computer and use it in GitHub Desktop.
An example service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExampleClientService implements ExampleListener { | |
private final List<ExampleListener> listeners = new ArrayList<ExampleListener>(); | |
private final List<Example> examples = new ArrayList<Example>(); | |
public void addExampleListener(ExampleListener listener) { | |
listeners.add(listener); | |
} | |
public void removeExampleListener(ExampleListener listener) { | |
listeners.remove(listener); | |
} | |
/** {@inheritDoc} */ | |
@Override | |
public void goodExampleDispatched(Example example) { | |
copyExample(example); | |
} | |
/** {@inheritDoc} */ | |
@Override | |
public void badExampleDispatched(Example example) { | |
copyExample(Example); | |
} | |
private void copyExample(Example example) { | |
// Copy Example into list and then send list to all listeners. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment