mirror of https://github.com/deavmi/JavaOCP
Compare commits
3 Commits
69cd2fadd6
...
9b64b6869a
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | 9b64b6869a | |
Tristan B. Velloza Kildaire | dfd6f3af05 | |
Tristan B. Velloza Kildaire | 93df7201bb |
|
@ -0,0 +1,2 @@
|
|||
/META-INF/
|
||||
/ocp/
|
|
@ -0,0 +1 @@
|
|||
/ocp/
|
|
@ -0,0 +1,2 @@
|
|||
/META-INF/
|
||||
/ocp/
|
|
@ -0,0 +1 @@
|
|||
/ocp/
|
|
@ -0,0 +1,2 @@
|
|||
/META-INF/
|
||||
/ocp/
|
|
@ -0,0 +1 @@
|
|||
/ocp/
|
BIN
DB/Database/mydb
BIN
DB/Database/mydb
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
/ocp/
|
|
@ -2,4 +2,9 @@ module ocp.hello
|
|||
{
|
||||
exports ocp.practice.modules.Modules;
|
||||
requires transitive ocp.gendering;
|
||||
|
||||
opens ocp.practice.modules.Modules;
|
||||
|
||||
provides ocp.practice.modules.Modules.IDoable
|
||||
with ocp.practice.modules.Modules.DoableImpl;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package ocp.practice.modules.Modules;
|
||||
|
||||
public class DoableImpl implements IDoable
|
||||
{
|
||||
|
||||
@Override
|
||||
public void doTing()
|
||||
{
|
||||
System.out.println("I am doing da thang");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package ocp.practice.modules.Modules;
|
||||
|
||||
public interface IDoable
|
||||
{
|
||||
public void doTing();
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
module ocp.practice.using
|
||||
{
|
||||
requires ocp.hello;
|
||||
|
||||
uses ocp.practice.modules.Modules.IDoable;
|
||||
}
|
|
@ -1,7 +1,12 @@
|
|||
package ocp.practice.using.Greeting;
|
||||
|
||||
import ocp.practice.modules.Modules.Hello;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
import ocp.gendering.gendering.Gender;
|
||||
import ocp.practice.modules.Modules.IDoable;
|
||||
|
||||
/**
|
||||
* Modules
|
||||
|
@ -16,5 +21,11 @@ public class Greeter
|
|||
Hello.hello("Bobby!");
|
||||
Gender gender = Hello.getGender();
|
||||
System.out.println("Gender is: "+gender);
|
||||
|
||||
Iterable<IDoable> services = ServiceLoader.load(IDoable.class);
|
||||
for(IDoable service: services)
|
||||
{
|
||||
service.doTing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue