Source Code Cross Referenced for ProxyPushConsumerImpl.java in  » Collaboration » JacORB » org » jacorb » events » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Collaboration » JacORB » org.jacorb.events 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.jacorb.events;
002:
003:        /*
004:         *        JacORB - a free Java ORB
005:         *
006:         *   Copyright (C) 1997-2004 Gerald Brose.
007:         *
008:         *   This library is free software; you can redistribute it and/or
009:         *   modify it under the terms of the GNU Library General Public
010:         *   License as published by the Free Software Foundation; either
011:         *   version 2 of the License, or (at your option) any later version.
012:         *
013:         *   This library is distributed in the hope that it will be useful,
014:         *   but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:         *   Library General Public License for more details.
017:         *
018:         *   You should have received a copy of the GNU Library General Public
019:         *   License along with this library; if not, write to the Free
020:         *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021:         */
022:
023:        import org.omg.CosEventComm.*;
024:        import org.omg.CosEventChannelAdmin.*;
025:        import org.omg.PortableServer.*;
026:        import org.omg.CORBA.*;
027:        import org.jacorb.orb.*;
028:
029:        /**
030:         * Implementation of COSEventChannelAdmin interface; ProxyPushConsumer.
031:         * This defines connect_push_supplier(), disconnect_push_consumer() and the all
032:         * important push() method that the Supplier can call to actuall deliver a
033:         * message.
034:         *
035:         * 2002/23/08 JFC OMG EventService Specification 1.1 page 2-7 states:
036:         *      "Registration is a two step process.  An event-generating application
037:         *      first obtains a proxy consumer from a channel, then 'connects' to the
038:         *      proxy consumer by providing it with a supplier.  ...  The reason for
039:         *      the two step registration process..."
040:         *    Modifications to support the above have been made as well as to support
041:         *    section 2.1.5 "Disconnection Behavior" on page 2-4.
042:         *
043:         * @author Jeff Carlson, Joerg v. Frantzius, Rainer Lischetzki, Gerald Brose
044:         * @version $Id: ProxyPushConsumerImpl.java,v 1.8 2004/05/06 12:39:58 nicolas Exp $
045:         */
046:        public class ProxyPushConsumerImpl extends
047:                org.omg.CosEventChannelAdmin.ProxyPushConsumerPOA {
048:            private EventChannelImpl myEventChannel;
049:            private PushSupplier myPushSupplier;
050:            private org.omg.PortableServer.POA myPoa;
051:            private boolean connected;
052:
053:            /**
054:             * Konstruktor - wird von EventChannel aufgerufen
055:             */
056:            protected ProxyPushConsumerImpl(EventChannelImpl ec,
057:                    org.omg.CORBA.ORB orb, org.omg.PortableServer.POA poa) {
058:                myEventChannel = ec;
059:                myPoa = poa;
060:                connected = false;
061:                _this _object(orb);
062:            }
063:
064:            /**
065:             * fuers ProxyPushConsumer Interface:
066:             * As stated by the EventService specification 1.1 section 2.3.4:
067:             * "If a ProxyPushConsumer is already connected to a PushSupplier, then the
068:             *  AlreadyConnected exception is raised."
069:             *  and
070:             * "If a non-nil reference is passed to connect_push_supplier..." implying
071:             * that a null reference is acceptable.
072:             */
073:            public void connect_push_supplier(PushSupplier pushSupplier)
074:                    throws org.omg.CosEventChannelAdmin.AlreadyConnected {
075:                if (connected) {
076:                    throw new org.omg.CosEventChannelAdmin.AlreadyConnected();
077:                }
078:                myPushSupplier = pushSupplier;
079:                connected = true;
080:            }
081:
082:            /**
083:             * fuers PushConsumer Interface:
084:             * See EventService v 1.1 specification section 2.1.1.
085:             *   'disconnect_push_consumer terminates the event communication; it releases
086:             *   resources used at the consumer to support event communication.  Calling
087:             *   this causes the implementation to call disconnect_push_supplier operation
088:             *   on the corresponding PushSupplier interface (if that iterface is known).'
089:             * See EventService v 1.1 specification section 2.1.5.  This method should
090:             *   adhere to the spec as it a) causes a call to the corresponding disconnect
091:             *   on the connected supplier, b) 'If a consumer or supplier has received a
092:             *   disconnect call and subsequently receives another disconnect call, it
093:             *   shall raise a CORBA::OBJECT_NOT_EXIST exception.
094:             */
095:            public void disconnect_push_consumer() {
096:                if (connected) {
097:                    if (myPushSupplier != null) {
098:                        myPushSupplier.disconnect_push_supplier();
099:                        myPushSupplier = null;
100:                    }
101:                    connected = false;
102:                } else {
103:                    throw new org.omg.CORBA.OBJECT_NOT_EXIST();
104:                }
105:            }
106:
107:            /**
108:             * Supplier sends data to the consumer (this object) using this call.
109:             */
110:            public void push(org.omg.CORBA.Any event)
111:                    throws org.omg.CosEventComm.Disconnected {
112:                if (!connected) {
113:                    throw new org.omg.CosEventComm.Disconnected();
114:                }
115:                myEventChannel.push_event(event);
116:            }
117:
118:            /**
119:             * Override this method from the Servant baseclass.  Fintan Bolton
120:             * in his book "Pure CORBA" suggests that you override this method to
121:             * avoid the risk that a servant object (like this one) could be
122:             * activated by the <b>wrong</b> POA object.
123:             */
124:            public org.omg.PortableServer.POA _default_POA() {
125:                return myPoa;
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.