diff options
| author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
|---|---|---|
| committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
| commit | 3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 (patch) | |
| tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java | |
| parent | 7e55c49d7d91ef9f09e93c1100119b1ab3652446 (diff) | |
| download | ppe42-gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.tar.gz ppe42-gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.zip | |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java')
| -rw-r--r-- | libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java b/libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java index 6c1b5644f36..7710306b748 100644 --- a/libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java +++ b/libjava/classpath/gnu/CORBA/Poa/gnuPOAManager.java @@ -40,6 +40,8 @@ package gnu.CORBA.Poa; import org.omg.CORBA.BAD_INV_ORDER; import org.omg.CORBA.LocalObject; +import org.omg.PortableInterceptor.NON_EXISTENT; +import org.omg.PortableInterceptor.ObjectReferenceTemplate; import org.omg.PortableServer.POAManager; import org.omg.PortableServer.POAManagerPackage.AdapterInactive; import org.omg.PortableServer.POAManagerPackage.State; @@ -59,18 +61,22 @@ public class gnuPOAManager extends LocalObject implements POAManager { + /** + * Use serialVersionUID for interoperability. + */ + private static final long serialVersionUID = 1; + /** - * The POAs, controlled by this manager. The members must be instances of - * the gnuAbstractPOA. + * The POAs, controlled by this manager. */ - HashSet POAs = new HashSet(); + private HashSet POAs = new HashSet(); /** * The state of the manager. The newly created manager is always * in the holding state. */ State state = State.HOLDING; - + /** * Get the state of the POA manager. */ @@ -94,6 +100,8 @@ public class gnuPOAManager state = State.ACTIVE; else throw new AdapterInactive(); + + notifyInterceptors(state.value()); } /** @@ -113,6 +121,9 @@ public class gnuPOAManager state = State.HOLDING; else throw new AdapterInactive(); + + notifyInterceptors(state.value()); + if (wait_for_completion) waitForIdle(); } @@ -144,6 +155,9 @@ public class gnuPOAManager if (state == State.INACTIVE) throw new AdapterInactive("Repetetive inactivation"); state = State.INACTIVE; + + notifyInterceptors(state.value()); + if (wait_for_completion) waitForIdle(); @@ -178,6 +192,9 @@ public class gnuPOAManager state = State.DISCARDING; else throw new AdapterInactive(); + + notifyInterceptors(state.value()); + if (wait_for_completion) waitForIdle(); } @@ -193,11 +210,13 @@ public class gnuPOAManager { if (state == State.ACTIVE) throw new BAD_INV_ORDER("The state is active"); - + + gnuPOA poa; Iterator iter = POAs.iterator(); + while (iter.hasNext()) { - gnuPOA poa = (gnuPOA) iter.next(); + poa = (gnuPOA) iter.next(); poa.waitWhileRunning(); } } @@ -222,4 +241,33 @@ public class gnuPOAManager { POAs.remove(poa); } + + /** + * This method is called when POA is destryed. The interceptors are + * notified. + */ + public void poaDestroyed(gnuPOA poa) + { + notifyInterceptors(NON_EXISTENT.value); + } + + /** + * Notify CORBA 3.0 interceptors about the status change. + */ + public synchronized void notifyInterceptors(int new_state) + { + gnuPOA poa; + Iterator iter = POAs.iterator(); + + // The System.identityHashCode is also called in gnuIorInfo. + while (iter.hasNext()) + { + poa = (gnuPOA) iter.next(); + if (poa.m_orb.iIor != null) + { + poa.m_orb.iIor.adapter_manager_state_changed( + System.identityHashCode(this), (short) new_state); + } + } + } }
\ No newline at end of file |

