public final class MongoClientObjectFactory extends Object implements ObjectFactory
javax.naming.spi.ObjectFactory
that produces instance of com.mongodb.MongoClient
.
This class can be used to create a custom JNDI resource in an application server.
See wildfly.home/docs/schema/jboss-as-naming_2_0.xsd for more details.Constructor and Description |
---|
MongoClientObjectFactory() |
Modifier and Type | Method and Description |
---|---|
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
Gets an instance of
com.mongodb.MongoClient based on the resource configuration in the application server. |
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
com.mongodb.MongoClient
based on the resource configuration in the application server.
The parameter environment
contains MongoDB client connection properties, and accepts the following property:
getObjectInstance
in interface ObjectFactory
obj
- the JNDI name of com.mongodb.MongoClient
resourcename
- always nullnameCtx
- always nullenvironment
- a Hashtable
of configuration properties for com.mongodb.MongoClient
com.mongodb.MongoClient
Exception
- any exception occurredCopyright © 2018 JBoss by Red Hat. All rights reserved.