Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
View | Details | Raw Unified | Return to bug 527
Collapse All | Expand All

(-)AOM.java (-4 / +23 lines)
Lines 27-32 Link Here
27
import org.jacorb.poa.util.ByteArrayKey;
27
import org.jacorb.poa.util.ByteArrayKey;
28
import org.jacorb.poa.util.POAUtil;
28
import org.jacorb.poa.util.POAUtil;
29
import org.jacorb.poa.util.StringPair;
29
import org.jacorb.poa.util.StringPair;
30
import org.jacorb.util.threadpool.Consumer;
31
import org.jacorb.util.threadpool.ConsumerFactory;
32
import org.jacorb.util.threadpool.ThreadPool;
30
33
31
import org.omg.PortableServer.POAPackage.ObjectAlreadyActive;
34
import org.omg.PortableServer.POAPackage.ObjectAlreadyActive;
32
import org.omg.PortableServer.POAPackage.ObjectNotActive;
35
import org.omg.PortableServer.POAPackage.ObjectNotActive;
Lines 69-74 Link Here
69
    /** a lock to protect two consecutive operations on the list, used
72
    /** a lock to protect two consecutive operations on the list, used
70
        in remove() */
73
        in remove() */
71
    private Object              deactivationListLock = new Object();
74
    private Object              deactivationListLock = new Object();
75
    
76
    private Consumer deactivationConsumer = new Consumer() {
77
        public void doWork(final Object job) {
78
            try {
79
                ((Runnable)job).run() ;
80
            } catch (final Throwable th) {
81
                logger.info("Unhandled exception during deactivation", th);
82
            }
83
        } 
84
    } ;
85
    private ConsumerFactory deactivationConsumerFactory = new ConsumerFactory() {
86
        public Consumer create() {
87
            return deactivationConsumer ;
88
        }
89
    } ;
90
    
91
    private ThreadPool deactivationPool = new ThreadPool(deactivationConsumerFactory) ;
72
92
73
    private AOM()
93
    private AOM()
74
    {
94
    {
Lines 348-355 Link Here
348
        final POA poa_ = poa;
368
        final POA poa_ = poa;
349
        final boolean cleanupInProgress_ = cleanupInProgress;
369
        final boolean cleanupInProgress_ = cleanupInProgress;
350
370
351
        Thread thread = new Thread("AOM_RemovalThread")
371
        final Runnable job = new Runnable() {
352
        {
353
            public void run()
372
            public void run()
354
            {
373
            {
355
                _remove(
374
                _remove(
Lines 361-368 Link Here
361
                       );
380
                       );
362
            }
381
            }
363
        };
382
        };
364
383
        
365
        thread.start();
384
        deactivationPool.putJob(job) ;
366
    }
385
    }
367
386
368
387

Return to bug 527