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