/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Stream-based implementation of the RemoteCall interface.
*
* @author Ann Wollrath
*/
private boolean resultStarted = false;
conn = c;
}
throws RemoteException
{
try {
conn = c;
"write remote call header...");
// write out remote call header info...
// call header, part 1 (read by Transport)
getOutputStream(); // creates a MarshalOutputStream
// call header, part 2 (read by Dispatcher)
} catch (IOException e) {
throw new MarshalException("Error marshaling call header", e);
}
}
/**
* Return the connection associated with this call.
*/
return conn;
}
/**
* into.
*/
return getOutputStream(false);
}
throws IOException
{
}
return out;
}
/**
* Release the outputStream Currently, will not complain if the
* output stream is released more than once.
*/
try {
try {
} finally {
}
}
} finally {
}
}
/**
* from.
*/
}
return in;
}
/**
* Release the input stream, this would allow some transports to release
* the channel early.
*/
/* WARNING: Currently, the UnicastRef.java invoke methods rely
* upon this method not throwing an IOException.
*/
try {
// execute MarshalInputStream "done" callbacks
try {
} catch (RuntimeException e) {
}
// add saved references to DGC table
in.registerRefs();
/* WARNING: The connection being passed to done may have
* already been freed.
*/
}
} finally {
}
}
/**
* Returns an output stream (may put out header information
* relating to the success of the call).
* @param success If true, indicates normal return, else indicates
* exceptional return.
* @exception StreamCorruptedException If result stream previously
* acquired
* @exception IOException For any other problem with I/O.
*/
/* make sure result code only marshaled once. */
if (resultStarted)
throw new StreamCorruptedException("result already in progress");
else
resultStarted = true;
// write out return header
// return header, part 1 (read by Transport)
getOutputStream(true); // creates a MarshalOutputStream
// return header, part 2 (read by client-side RemoteCall)
if (success) //
else
return out;
}
/**
* Do whatever it takes to execute the call.
*/
@SuppressWarnings("fallthrough")
byte returnType;
// read result header
try {
}
"transport return code invalid: " + op);
}
throw new UnmarshalException("Transport return code invalid");
}
} catch (UnmarshalException e) {
throw e;
} catch (IOException e) {
throw new UnmarshalException("Error unmarshaling return header",
e);
} finally {
if (ackHandler != null) {
}
}
// read return value
switch (returnType) {
break;
try {
} catch (Exception e) {
throw new UnmarshalException("Error unmarshaling return", e);
}
// An exception should have been received,
// if so throw it, else flag error
} else {
throw new UnmarshalException("Return type not Exception");
}
// Exception is thrown before fallthrough can occur
default:
"return code invalid: " + returnType);
}
throw new UnmarshalException("Return code invalid");
}
}
/**
* Routine that causes the stack traces of remote exceptions to be
* filled in with the current stack trace on the client. Detail
* exceptions are filled in iteratively.
*/
/*
* Log the details of a server exception thrown as a result of a
* remote method invocation.
*/
/* log call exception returned from server before it is rethrown */
}
throw ex;
}
/*
* method to retrieve possible server side exceptions (which will
* be throw from exceptionReceivedFromServer(...) )
*/
return serverException;
}
/* WARNING: Currently, the UnicastRef.java invoke methods rely
* upon this method not throwing an IOException.
*/
}
}