下面列出了怎么用org.omg.CORBA.Request的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Send multiple dynamic requests asynchronously.
*
* @param req an array of request objects.
*/
public synchronized void send_multiple_requests_deferred(Request[] req)
{
checkShutdownState();
// add the new Requests to pending dynamic Requests
for (int i = 0; i < req.length; i++) {
dynamicRequests.addElement(req[i]);
}
// Invoke the send_deferred on each new Request
for (int i = 0; i < req.length; i++) {
AsynchInvoke invokeObject = new AsynchInvoke( this,
(com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
new Thread(null, invokeObject, "ORB-Request-Thread", 0, false).start();
}
}
/**
* Send multiple dynamic requests asynchronously.
*
* @param req an array of request objects.
*/
public synchronized void send_multiple_requests_deferred(Request[] req)
{
checkShutdownState();
// add the new Requests to pending dynamic Requests
for (int i = 0; i < req.length; i++) {
dynamicRequests.addElement(req[i]);
}
// Invoke the send_deferred on each new Request
for (int i = 0; i < req.length; i++) {
AsynchInvoke invokeObject = new AsynchInvoke( this,
(com.sun.corba.se.impl.corba.RequestImpl)req[i], true);
new Thread(invokeObject).start();
}
}
/**
* Get the next request that has gotten a response.
*
* @result the next request ready with a response.
*/
public org.omg.CORBA.Request get_next_response()
throws org.omg.CORBA.WrongTransaction
{
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
}
public synchronized void send_multiple_requests_oneway(Request[] req)
{
checkShutdownState();
// Invoke the send_oneway on each new Request
for (int i = 0; i < req.length; i++) {
req[i].send_oneway();
}
}
/**
* Get the next request that has gotten a response.
*
* @return the next request ready with a response.
*/
public org.omg.CORBA.Request get_next_response()
throws org.omg.CORBA.WrongTransaction
{
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
}
/**
* Get the next request that has gotten a response.
*
* @result the next request ready with a response.
*/
public org.omg.CORBA.Request get_next_response()
throws org.omg.CORBA.WrongTransaction
{
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
}
public synchronized void send_multiple_requests_oneway(Request[] req)
{
checkShutdownState();
// Invoke the send_oneway on each new Request
for (int i = 0; i < req.length; i++) {
req[i].send_oneway();
}
}
public synchronized void send_multiple_requests_oneway(Request[] req)
{
checkShutdownState();
// Invoke the send_oneway on each new Request
for (int i = 0; i < req.length; i++) {
req[i].send_oneway();
}
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list,
result, null, null);
}
public synchronized void send_multiple_requests_oneway(Request[] req)
{
checkShutdownState();
// Invoke the send_oneway on each new Request
for (int i = 0; i < req.length; i++) {
req[i].send_oneway();
}
}
/**
* Get the next request that has gotten a response.
*
* @result the next request ready with a response.
*/
public org.omg.CORBA.Request get_next_response()
throws org.omg.CORBA.WrongTransaction
{
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list,
result, null, null);
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result,
ExceptionList exclist,
ContextList ctxlist)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
exclist, ctxlist);
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result,
ExceptionList exclist,
ContextList ctxlist)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
exclist, ctxlist);
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result,
ExceptionList exclist,
ContextList ctxlist)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
exclist, ctxlist);
}
/**
* Get the next request that has gotten a response.
*
* @result the next request ready with a response.
*/
public org.omg.CORBA.Request get_next_response()
throws org.omg.CORBA.WrongTransaction
{
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result,
ExceptionList exclist,
ContextList ctxlist)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
exclist, ctxlist);
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list,
result, null, null);
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list,
result, null, null);
}
public synchronized void send_multiple_requests_oneway(Request[] req)
{
checkShutdownState();
// Invoke the send_oneway on each new Request
for (int i = 0; i < req.length; i++) {
req[i].send_oneway();
}
}
/**
* Get the next request that has gotten a response.
*
* @result the next request ready with a response.
*/
public org.omg.CORBA.Request get_next_response()
throws org.omg.CORBA.WrongTransaction
{
synchronized( this ) {
checkShutdownState();
}
while (true) {
// check if there already is a response
synchronized ( dynamicRequests ) {
Enumeration elems = dynamicRequests.elements();
while ( elems.hasMoreElements() ) {
Request currRequest = (Request)elems.nextElement();
if ( currRequest.poll_response() ) {
// get the response for this successfully polled Request
currRequest.get_response();
dynamicRequests.removeElement(currRequest);
return currRequest;
}
}
}
// wait for a response
synchronized(this.svResponseReceived) {
while (!this.svResponseReceived.value()) {
try {
this.svResponseReceived.wait();
} catch(java.lang.InterruptedException ex) {
// NO-OP
}
}
// reinitialize the response flag
this.svResponseReceived.reset();
}
}
}
public Request create_request(org.omg.CORBA.Object obj,
Context ctx,
String operation,
NVList arg_list,
NamedValue result,
ExceptionList exclist,
ContextList ctxlist)
{
return new RequestImpl(orb, obj, ctx, operation, arg_list, result,
exclist, ctxlist);
}
public Request _create_request( Context ctx, String operation, NVList arg_list,
NamedValue result)
{
return object._create_request( ctx, operation, arg_list, result ) ;
}
@Override
public Request get_next_response() throws WrongTransaction {
return null;
}
public Request request(org.omg.CORBA.Object obj, String operation)
{
return new RequestImpl(orb, obj, null, operation, null, null, null,
null);
}
public Request _request(String operation)
{
return object._request( operation ) ;
}
public org.omg.CORBA.Request get_next_response() {
throw new SecurityException("ORBSingleton: access denied");
}
public Request _create_request( Context ctx, String operation, NVList arg_list,
NamedValue result, ExceptionList exclist, ContextList ctxlist)
{
return object._create_request( ctx, operation, arg_list, result,
exclist, ctxlist ) ;
}
public void send_multiple_requests_oneway(Request[] req) {
throw new SecurityException("ORBSingleton: access denied");
}
public Request request(org.omg.CORBA.Object obj, String operation)
{
return new RequestImpl(orb, obj, null, operation, null, null, null,
null);
}