You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IMessage.java 586B

123456789101112131415161718192021222324252627
  1. public interface IMessage {
  2. void publish();
  3. }
  4. interface IErrorMessage extends IMessage{
  5. StackTraceElement[] getStackTrace();
  6. }
  7. interface IObjectFactory<E> {
  8. public <T extends E> T create(Class<T> theObjectType, Object[]
  9. theParameters);
  10. }
  11. class MessageFactory implements IObjectFactory<IMessage>{
  12. public <T extends IMessage> T create(Class<T> theObjectType, Object[]
  13. theParameters) {
  14. return null;
  15. }
  16. }
  17. class Main {
  18. public static void main(String[] args) {
  19. IErrorMessage message = new MessageFactory().create(IErrorMessage.class,
  20. new Object[]{"Foo","Bar"});
  21. }
  22. }