Created
August 4, 2011 04:23
-
-
Save binarycrayon/1124504 to your computer and use it in GitHub Desktop.
Lookup.Template example
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
// interface class, String ID of implementer class, testImpl is an alternative implementation of PreviewController | |
Lookup.Template template = new Lookup.Template(PreviewController.class, "org.gephi.preview.testImpl", null); | |
Result result = Lookup.getDefault().lookup(template); | |
Lookup.Item it=Lookup.getDefault().lookupItem(template); | |
PreviewController instance = it.getInstance(); | |
System.out.println("the instance is: " + instance.toString()); | |
// output: the instance is org.gephi.preview.testImpl@69fe571f | |
template = new Lookup.Template(PreviewController.class, "org.gephi.preview.PreviewControllerImpl", null); | |
it=Lookup.getDefault().lookupItem(template); | |
instance = it.getInstance(); | |
System.out.println("the instance is: " + instance.toString()); | |
//output: the instance is org.gephi.preview.PreviewControllerImpl@3909ea96 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment