public interface ObjectFactoryBuilder
JNDI框架允许对象的实现是通过在动态加载对象工厂。例如,当查找绑定在名称空间中的打印机时,如果打印服务将打印机名称绑定到引用时,可以使用打印机引用来创建一个打印机对象,以便查找的调用方可以在查找后直接操作打印机对象。一个化负责创建特定类型的对象。JNDI使用使用和加载对象工厂的默认策略。你可以通过一个objectfactorybuilder调用NamingManager.setObjectFactoryBuilder()覆盖默认的政策,其中包含程序定义的方式创建/加载对象工厂。任何ObjectFactoryBuilder实现必须实现这个接口,用于创建对象的工厂。
Modifier and Type | Method and Description |
---|---|
ObjectFactory |
createObjectFactory(Object obj, Hashtable<?,?> environment)
使用所提供的环境创建一个新的对象工厂。
|
ObjectFactory createObjectFactory(Object obj, Hashtable<?,?> environment) throws NamingException
环境参数是由调用方拥有的。该实现将不会修改对象或保持引用它,虽然它可能会保留一个复制或复制的参考。
obj
-它创建工厂可能的空对象。
environment
环境使用创建工厂时。可以为空。
NamingException
如果不能创建对象的工厂。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.