01: package com.almamater.crs.services.reporting.impl;
02:
03: /** Implementation of the standard JNDI Object factory **/
04: public class BSMiscellaneousQueriesFactory implements
05: javax.naming.spi.ObjectFactory {
06: private static Object sImplementationCreationSemaphore = new Object();
07: private static BSMiscellaneousQueriesImpl sImplementation = null;
08:
09: /* Returns the instance of the service */
10: public Object getObjectInstance(Object obj, javax.naming.Name name,
11: javax.naming.Context nameCtx,
12: java.util.Hashtable pEnvironment) throws Exception {
13: // Thread safe singleton implementaton - can create once and use all the time
14: if (sImplementation == null) {
15: synchronized (sImplementationCreationSemaphore) {
16: if (sImplementation == null)
17: sImplementation = new BSMiscellaneousQueriesImpl(
18: pEnvironment);
19: }
20: }
21: return sImplementation;
22: }
23: }
|