Package com.mongodb.client.jndi
Class MongoClientFactory
- java.lang.Object
-
- com.mongodb.client.jndi.MongoClientFactory
-
- All Implemented Interfaces:
javax.naming.spi.ObjectFactory
@Deprecated(since="2021-05-27") public class MongoClientFactory extends java.lang.Object implements javax.naming.spi.ObjectFactory
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.An ObjectFactory for MongoClient instances.- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description MongoClientFactory()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment)
Deprecated.This implementation will create instances ofMongoClient
based on a connection string conforming to the format specified inMongoClientURI
.
-
-
-
Method Detail
-
getObjectInstance
public java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment) throws java.lang.Exception
Deprecated.This implementation will create instances ofMongoClient
based on a connection string conforming to the format specified inMongoClientURI
.The connection string is specified in one of two ways:
- As the
String
value of a property in theenvironment
parameter with a key of"connectionString"
- As the
String
value of aRefAddr
with type"connectionString"
in anobj
parameter of typeReference
environment
parameter takes precedence over specification in theobj
parameter. Thename
andnameCtx
parameters are ignored. If a non-empty connection string is not specified in either of these two ways, aMongoException
is thrown.- Specified by:
getObjectInstance
in interfacejavax.naming.spi.ObjectFactory
- Returns:
- an instance of
MongoClient
based on the specified connection string - Throws:
MongoException
- Note: Not all options that can be specified viaMongoClientOptions
can be specified via the connection string.java.lang.Exception
- As the
-
-