Package com.mongodb.client.jndi
Class MongoClientFactory
java.lang.Object
com.mongodb.client.jndi.MongoClientFactory
- All Implemented Interfaces:
ObjectFactory
@Deprecated(since="2021-05-27")
public class MongoClientFactory
extends Object
implements 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 -
Method Summary
Modifier and TypeMethodDescriptiongetObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) Deprecated.This implementation will create instances ofMongoClientbased on a connection string conforming to the format specified inMongoClientURI.
-
Constructor Details
-
MongoClientFactory
public MongoClientFactory()Deprecated.
-
-
Method Details
-
getObjectInstance
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws ExceptionDeprecated.This implementation will create instances ofMongoClientbased on a connection string conforming to the format specified inMongoClientURI.The connection string is specified in one of two ways:
- As the
Stringvalue of a property in theenvironmentparameter with a key of"connectionString" - As the
Stringvalue of aRefAddrwith type"connectionString"in anobjparameter of typeReference
environmentparameter takes precedence over specification in theobjparameter. ThenameandnameCtxparameters are ignored. If a non-empty connection string is not specified in either of these two ways, aMongoExceptionis thrown.- Specified by:
getObjectInstancein interfaceObjectFactory- Returns:
- an instance of
MongoClientbased on the specified connection string - Throws:
MongoException- Note: Not all options that can be specified viaMongoClientOptionscan be specified via the connection string.Exception
- As the
-