KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > oa > poa > POAPolicyMediatorFactory


1 /*
2  * @(#)POAPolicyMediatorFactory.java 1.21 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.oa.poa ;
9
10 abstract class POAPolicyMediatorFactory {
11     // create an appropriate policy mediator based on the policies.
12
// Note that the policies object has already been validated before
13
// this call, so it can only contain valid combinations of POA policies.
14
static POAPolicyMediator create( Policies policies, POAImpl poa )
15     {
16     if (policies.retainServants()) {
17         if (policies.useActiveMapOnly())
18         return new POAPolicyMediatorImpl_R_AOM( policies, poa ) ;
19         else if (policies.useDefaultServant())
20         return new POAPolicyMediatorImpl_R_UDS( policies, poa ) ;
21         else if (policies.useServantManager())
22         return new POAPolicyMediatorImpl_R_USM( policies, poa ) ;
23         else
24         throw poa.invocationWrapper().pmfCreateRetain() ;
25     } else {
26         if (policies.useDefaultServant())
27         return new POAPolicyMediatorImpl_NR_UDS( policies, poa ) ;
28         else if (policies.useServantManager())
29         return new POAPolicyMediatorImpl_NR_USM( policies, poa ) ;
30         else
31         throw poa.invocationWrapper().pmfCreateNonRetain() ;
32     }
33     }
34 }
35
Popular Tags