01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1999-2003 Gerald Brose
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Library General Public License for more details.
15: *
16: * You should have received a copy of the GNU Library General Public
17: * License along with this library; if not, write to the Free
18: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19: *
20: */
21:
22: package org.jacorb.orb.policies;
23:
24: import org.omg.RTCORBA._ClientProtocolPolicyLocalBase;
25: import org.omg.RTCORBA.Protocol;
26: import org.omg.RTCORBA.ProtocolListHelper;
27:
28: /**
29: * @author Steve Osselton
30: * @version $Id: ClientProtocolPolicy.java,v 1.2 2006/07/07 10:55:41 alphonse.bendt Exp $
31: */
32: public class ClientProtocolPolicy extends
33: _ClientProtocolPolicyLocalBase {
34: private final Protocol[] protos;
35:
36: public ClientProtocolPolicy(Protocol[] protos) {
37: super ();
38: this .protos = protos;
39: }
40:
41: public ClientProtocolPolicy(org.omg.CORBA.Any any) {
42: this (ProtocolListHelper.extract(any));
43: }
44:
45: public int tag() {
46: if (protos[0] != null) {
47: return protos[0].protocol_type;
48: }
49: return org.omg.IOP.TAG_INTERNET_IOP.value;
50: }
51:
52: public Protocol[] protocols() {
53: return protos;
54: }
55:
56: public int policy_type() {
57: return org.omg.RTCORBA.CLIENT_PROTOCOL_POLICY_TYPE.value;
58: }
59:
60: public org.omg.CORBA.Policy copy() {
61: return new ClientProtocolPolicy(protos);
62: }
63:
64: public void destroy() {
65: }
66: }
|