diff options
Diffstat (limited to 'java/demo/Ice/value/ObjectFactory.java')
-rw-r--r-- | java/demo/Ice/value/ObjectFactory.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/java/demo/Ice/value/ObjectFactory.java b/java/demo/Ice/value/ObjectFactory.java new file mode 100644 index 00000000000..7ad406e6ed5 --- /dev/null +++ b/java/demo/Ice/value/ObjectFactory.java @@ -0,0 +1,34 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +class ObjectFactory implements Ice.ObjectFactory +{ + public Ice.Object + create(String type) + { + if(type.equals("::Demo::Printer")) + { + return new PrinterI(); + } + + if(type.equals("::Demo::DerivedPrinter")) + { + return new DerivedPrinterI(); + } + + assert(false); + return null; + } + + public void + destroy() + { + // Nothing to do + } +} |