ICE 3.4.2
[php5-ice-freebsdport.git] / java / test / Ice / background / BackgroundControllerI.java
blob8f1213cb640caad8c90b4d84fbf908e018573bdd
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
9 package test.Ice.background;
11 import test.Ice.background.Test._BackgroundControllerDisp;
13 class BackgroundControllerI extends _BackgroundControllerDisp
15 synchronized public void
16 pauseCall(String opName, Ice.Current current)
18 _pausedCalls.add(opName);
21 synchronized public void
22 resumeCall(String opName, Ice.Current current)
24 _pausedCalls.remove(opName);
25 notifyAll();
28 synchronized public void
29 checkCallPause(Ice.Current current)
31 while(_pausedCalls.contains(current.operation))
33 try
35 wait();
36 break;
38 catch(java.lang.InterruptedException ex)
44 public void
45 holdAdapter(Ice.Current current)
47 _adapter.hold();
50 public void
51 resumeAdapter(Ice.Current current)
53 _adapter.activate();
56 public void
57 initializeSocketStatus(int status, Ice.Current current)
59 _configuration.initializeSocketStatus(status);
62 public void
63 initializeException(boolean enable, Ice.Current current)
65 _configuration.initializeException(enable ? new Ice.SocketException() : null);
68 public void
69 readReady(boolean enable, Ice.Current current)
71 _configuration.readReady(enable);
74 public void
75 readException(boolean enable, Ice.Current current)
77 _configuration.readException(enable ? new Ice.SocketException() : null);
80 public void
81 writeReady(boolean enable, Ice.Current current)
83 _configuration.writeReady(enable);
86 public void
87 writeException(boolean enable, Ice.Current current)
89 _configuration.writeException(enable ? new Ice.SocketException() : null);
92 public
93 BackgroundControllerI(Configuration configuration, Ice.ObjectAdapter adapter)
95 _adapter = adapter;
96 _configuration = configuration;
99 final private Ice.ObjectAdapter _adapter;
100 final private java.util.Set<String> _pausedCalls = new java.util.HashSet<String>();
101 final private Configuration _configuration;