本文整理汇总了Java中org.omg.PortableServer.POAManagerPackage.AdapterInactive类的典型用法代码示例。如果您正苦于以下问题:Java AdapterInactive类的具体用法?Java AdapterInactive怎么用?Java AdapterInactive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AdapterInactive类属于org.omg.PortableServer.POAManagerPackage包,在下文中一共展示了AdapterInactive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deactivate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
*
* Turns the asociated POAs into inactive state. The POAs in the incative
* state will reject new requests. If the POA is once inactivated, it
* cannot be activated again. The operation is used when
* the associated POAs are to be shut down.
*
* @param etherealize_objects if true, the servant managers of the
* associated POAs, having RETAIN and USE_SERVANT_MANAGER policies,
* will receive a call of {@link ServantActivatorOperations#etherealize}.
*
* @param wait_for_completion if true, the method call suspends the current
* thread till POAs complete the requests they are currently processing. If
* false, the method returns immediately.
*
* @throws AdapterInactive if the POAs are already in the inactive state.
*
* @see POAOperations#destroy
*/
public void deactivate(boolean etherealize_objects,
boolean wait_for_completion
)
throws AdapterInactive
{
if (state == State.INACTIVE)
throw new AdapterInactive("Repetetive inactivation");
state = State.INACTIVE;
notifyInterceptors(state.value());
if (wait_for_completion)
waitForIdle();
Iterator iter = POAs.iterator();
while (iter.hasNext())
{
gnuPOA poa = (gnuPOA) iter.next();
// If the servant activator is non null, this means it has been
// set - hence the policies are appropriate.
if (poa.servant_activator != null)
poa.etherealizeAll();
}
}
示例2: deactivate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
*
* Turns the asociated POAs into inactive state. The POAs in the incative
* state will reject new requests. If the POA is once inactivated, it
* cannot be activated again. The operation is used when
* the associated POAs are to be shut down.
*
* @param etherealize_objects if true, the servant managers of the
* associated POAs, having RETAIN and USE_SERVANT_MANAGER policies,
* will receive a call of {@link ServantActivatorOperations#etherealize}.
*
* @param wait_for_completion if true, the method call suspends the current
* thread till POAs complete the requests they are currently processing. If
* false, the method returns immediately.
*
* @throws AdapterInactive if the POAs are already in the inactive state.
*
* @see POAOperations#destroy
*/
public void deactivate(boolean etherealize_objects,
boolean wait_for_completion
)
throws AdapterInactive
{
if (state == State.INACTIVE)
throw new AdapterInactive("Repetetive inactivation");
state = State.INACTIVE;
notifyInterceptors(state.value());
if (wait_for_completion)
waitForIdle();
Iterator iter = POAs.iterator();
while (iter.hasNext())
{
gnuPOA poa = (gnuPOA) iter.next();
// If the servant activator is non null, this means it has been
// set - hence the policies are appropriate.
if (poa.servant_activator != null)
poa.etherealizeAll();
}
}
示例3: activate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* This operation changes the POA manager to ACTIVE.
*
* @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
* If POA manager state is INACTIVE.
*/
public void activate()
throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
// State change -> ACTIVE
synchronized (m_state_mutex) {
if (m_state == State.INACTIVE) {
throw new AdapterInactive();
}
if (m_state != State.ACTIVE) {
m_completion.stopWaiting();
m_state = State.ACTIVE;
m_state_mutex.notifyAll();
}
}
}
示例4: hold_requests
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* This operation changes the POA manager to HOLDING.
*
* @param wait_for_completion
* Wait-for-completion flag.
* @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
* If POA manager state is INACTIVE.
*/
public void hold_requests(boolean wait_for_completion)
throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
// State change -> HOLDING
synchronized (m_state_mutex) {
if (m_state == State.INACTIVE) {
throw new AdapterInactive();
}
if (m_state != State.HOLDING) {
m_completion.stopWaiting();
m_state = State.HOLDING;
m_state_mutex.notifyAll();
}
}
// Wait for completion, if necessary
if (wait_for_completion && m_completion.conditionToWait()) {
m_completion.waitForCompletion(); // synchronized
}
}
示例5: discard_requests
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* This operation changes the POA manager to DISCARDING.
*
* @param wait_for_completion
* Wait-for-completion flag.
* @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
* If POA manager state is INACTIVE.
*/
public void discard_requests(boolean wait_for_completion)
throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
// State change -> DISCARDING
synchronized (m_state_mutex) {
if (m_state == State.INACTIVE) {
throw new AdapterInactive();
}
if (m_state != State.DISCARDING) {
m_completion.stopWaiting();
m_state = State.DISCARDING;
m_state_mutex.notifyAll();
}
}
// Wait for completion, if necessary
if (wait_for_completion && m_completion.conditionToWait()) {
m_completion.waitForCompletion(); // synchronized
}
}
示例6: activate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into active state, allowing them to receive
* and process requests.
*
* @throws AdapterInactive if the POAs are in the inactive state.
* If once inactivated, the POA cannot be activated again. This
* method can only be called to leave the holding or discarding state.
*/
public void activate()
throws AdapterInactive
{
if (state != State.INACTIVE)
state = State.ACTIVE;
else
throw new AdapterInactive();
notifyInterceptors(state.value());
}
示例7: hold_requests
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into holding state. In this state, the POAs
* queue incoming requests but do not process them.
*
* @param wait_for_completion if true, the method call suspends the current
* thread till POAs complete the requests they are currently processing. If
* false, the method returns immediately.
* @throws AdapterInactive if the POAs are in the inactive state.
*/
public void hold_requests(boolean wait_for_completion)
throws AdapterInactive
{
if (state != State.INACTIVE)
state = State.HOLDING;
else
throw new AdapterInactive();
notifyInterceptors(state.value());
if (wait_for_completion)
waitForIdle();
}
示例8: discard_requests
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into discaring state. In this state, the POAs
* discard the incoming requests. This mode is used in situations when
* the server is flooded with requests. The client receives remote exception
* ({@link org.omg.CORBA.TRANSIENT}, minor code 1).
*
* @param wait_for_completion if true, the method call suspends the current
* thread till POAs complete the requests they are currently processing. If
* false, the method returns immediately.
* @throws AdapterInactive if the POAs are in the inactive state.
*/
public void discard_requests(boolean wait_for_completion)
throws AdapterInactive
{
if (state != State.INACTIVE)
state = State.DISCARDING;
else
throw new AdapterInactive();
notifyInterceptors(state.value());
if (wait_for_completion)
waitForIdle();
}
示例9: activate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into active state, allowing them to receive
* and process requests.
*
* @throws AdapterInactive if the POAs are in the inactive state.
* If once inactivated, the POA cannot be activated again. This
* method can only be called to leave the holding or discarding state.
*/
public void activate()
throws AdapterInactive
{
if (state != State.INACTIVE)
state = State.ACTIVE;
else
throw new AdapterInactive();
notifyInterceptors(state.value());
}
示例10: hold_requests
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into holding state. In this state, the POAs
* queue incoming requests but do not process them.
*
* @param wait_for_completion if true, the method call suspends the current
* thread till POAs complete the requests they are currently processing. If
* false, the method returns immediately.
* @throws AdapterInactive if the POAs are in the inactive state.
*/
public void hold_requests(boolean wait_for_completion)
throws AdapterInactive
{
if (state != State.INACTIVE)
state = State.HOLDING;
else
throw new AdapterInactive();
notifyInterceptors(state.value());
if (wait_for_completion)
waitForIdle();
}
示例11: discard_requests
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into discaring state. In this state, the POAs
* discard the incoming requests. This mode is used in situations when
* the server is flooded with requests. The client receives remote exception
* ({@link org.omg.CORBA.TRANSIENT}, minor code 1).
*
* @param wait_for_completion if true, the method call suspends the current
* thread till POAs complete the requests they are currently processing. If
* false, the method returns immediately.
* @throws AdapterInactive if the POAs are in the inactive state.
*/
public void discard_requests(boolean wait_for_completion)
throws AdapterInactive
{
if (state != State.INACTIVE)
state = State.DISCARDING;
else
throw new AdapterInactive();
notifyInterceptors(state.value());
if (wait_for_completion)
waitForIdle();
}
示例12: main
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
public static void main(String[] args) throws InvalidName, ServantAlreadyActive, WrongPolicy, ObjectNotActive, FileNotFoundException, AdapterInactive {
ORB orb = ORB.init(args, null);
POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
ServerStationImpl spvmServerStation = new ServerStationImpl("SPVM", 15140);
byte[] id1 = rootPOA.activate_object(spvmServerStation);
org.omg.CORBA.Object ref1 = rootPOA.id_to_reference(id1);
String ior1 = orb.object_to_string(ref1);
System.out.println(ior1);
PrintWriter file1 = new PrintWriter("spvm_ior.txt");
file1.println(ior1);
file1.close();
ServerStationImpl splServerStation = new ServerStationImpl("SPL", 14500);
byte[] id2 = rootPOA.activate_object(splServerStation);
org.omg.CORBA.Object ref2 = rootPOA.id_to_reference(id2);
String ior2 = orb.object_to_string(ref2);
System.out.println(ior2);
PrintWriter file2 = new PrintWriter("spl_ior.txt");
file2.println(ior2);
file2.close();
ServerStationImpl spbServerStation = new ServerStationImpl("SPB", 15790);
byte[] id3 = rootPOA.activate_object(spbServerStation);
org.omg.CORBA.Object ref3 = rootPOA.id_to_reference(id3);
String ior3 = orb.object_to_string(ref3);
System.out.println(ior3);
PrintWriter file3 = new PrintWriter("spb_ior.txt");
file3.println(ior3);
file3.close();
rootPOA.the_POAManager().activate();
orb.run();
}
示例13: main
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
public static void main(String[] args) throws InvalidName, ServantAlreadyActive, WrongPolicy, ObjectNotActive, FileNotFoundException, AdapterInactive {
final ORB orb = ORB.init(args, null);
POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
ServerStationImpl spvmServerStation = new ServerStationImpl("SPVM", SPVM_PORT_NUMBER_external);
Thread t1 = new Thread(spvmServerStation);
t1.start();
ServerStationImpl.addThread(t1);
byte[] id1 = rootPOA.activate_object(spvmServerStation);
org.omg.CORBA.Object ref1 = rootPOA.id_to_reference(id1);
String ior1 = orb.object_to_string(ref1);
System.out.println(ior1);
PrintWriter file1 = new PrintWriter("spvm_ior.txt");
file1.println(ior1);
file1.close();
ServerStationImpl splServerStation = new ServerStationImpl("SPL", SPL_PORT_NUMBER_external);
Thread t2 = new Thread(splServerStation);
t2.start();
ServerStationImpl.addThread(t2);
byte[] id2 = rootPOA.activate_object(splServerStation);
org.omg.CORBA.Object ref2 = rootPOA.id_to_reference(id2);
String ior2 = orb.object_to_string(ref2);
System.out.println(ior2);
PrintWriter file2 = new PrintWriter("spl_ior.txt");
file2.println(ior2);
file2.close();
ServerStationImpl spbServerStation = new ServerStationImpl("SPB", SPB_PORT_NUMBER_external);
Thread t3 = new Thread(spbServerStation);
t3.start();
ServerStationImpl.addThread(t3);
byte[] id3 = rootPOA.activate_object(spbServerStation);
org.omg.CORBA.Object ref3 = rootPOA.id_to_reference(id3);
String ior3 = orb.object_to_string(ref3);
System.out.println(ior3);
PrintWriter file3 = new PrintWriter("spb_ior.txt");
file3.println(ior3);
file3.close();
rootPOA.the_POAManager().activate();
//need thread to run this in order to add it to the list of thread to be killed if reboot
Thread orbThread = new Thread(new Runnable() {
@Override
public void run() {
orb.run();
}
});
ServerStationImpl.addThread(orbThread);
}
示例14: deactivate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* This operation changes the POA manager to DEACTIVATE.
*
* @param etherealize_object
* If it is true, then all objects must be etherealized.
* @param wait_for_completion
* Wait-for-completion flag.
* @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive
* If POA manager state is INACTIVE.
*/
public void deactivate(boolean etherealize_objects,
boolean wait_for_completion)
throws org.omg.PortableServer.POAManagerPackage.AdapterInactive
{
// State change -> INACTIVE
synchronized (m_state_mutex) {
if (m_state == State.INACTIVE) {
throw new AdapterInactive();
}
// reset the last completion waiters
m_completion.stopWaiting();
m_pool.deactivation();
m_request_queue.deactivation();
m_state = State.INACTIVE;
synchronized (m_orb.m_POAManagers) {
for (int i = 0; i < m_orb.m_POAManagers.size(); i++) {
if (m_orb.m_POAManagers.elementAt(i) == this)
m_orb.m_POAManagers.removeElementAt(i);
}
}
}
// Wait for completion, if necessary
if (wait_for_completion && m_completion.conditionToWait()) {
m_completion.waitForCompletion(); //synchronized
if (etherealize_objects) {
// Etherealize objects (blocking)
etherealizeAllPOAs();
}
} else if (etherealize_objects) {
// Etherealize in background
EtherealizerThread t = new EtherealizerThread(this);
t.start();
}
}
示例15: activate
import org.omg.PortableServer.POAManagerPackage.AdapterInactive; //导入依赖的package包/类
/**
* Turns the associated POAs into active state, allowing them to receive
* and process requests.
*
* @throws AdapterInactive if the POAs are in the inactive state. If
* once inactivated, the POA cannot be activated again.
* This method can only be called to leave the holding or discarding state.
*/
void activate()
throws AdapterInactive;