Remote System Explorer DataStore
Release 3.3

org.eclipse.dstore.core.java
Class ClassByteStreamHandler

java.lang.Object
  extended by org.eclipse.dstore.core.java.ClassByteStreamHandler
All Implemented Interfaces:
IClassByteStreamHandler

public class ClassByteStreamHandler
extends Object
implements IClassByteStreamHandler

The ClassByteStreamHandler class is used to abstract classfile read and write operations across the network. By default this is used for sending and receiving class files on the client and the server. The class can be extended if the default byte stream implementations are not sufficient for a particular platform or use.

If ClassByteStreamHandler is extended, you need to tell the DataStore to use the extended implementation. To do that, call DataStore.setClassByteStreamHandler(ClassByteStreamHandler).


Nested Class Summary
protected  class ClassByteStreamHandler.ReceiveClassInstanceThread
          A new thread that can be spawned to receive the class
protected  class ClassByteStreamHandler.ReceiveClassThread
          A new thread that can be spawned to receive the class
 
Field Summary
protected  DataStore _dataStore
           
protected  DataElement _log
           
protected static String FILEMSG_REMOTE_SAVE_FAILED
           
 
Constructor Summary
ClassByteStreamHandler(DataStore dataStore, DataElement log)
          Contructor
 
Method Summary
protected  DataElement findStatusFor(String remotePath)
           
 String getIdentifier()
          Returns the unique ID for this bytestream handler
 void receiveBytes(String className, byte[] buffer, int size)
          Receive a class and load it.
 void receiveInstanceBytes(byte[] buffer, int size)
          Receive a class instance and load it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dataStore

protected DataStore _dataStore

_log

protected DataElement _log

FILEMSG_REMOTE_SAVE_FAILED

protected static final String FILEMSG_REMOTE_SAVE_FAILED
See Also:
Constant Field Values
Constructor Detail

ClassByteStreamHandler

public ClassByteStreamHandler(DataStore dataStore,
                              DataElement log)
Contructor

Parameters:
dataStore - the DataStore instance
log - the log in which to log status and messages
Method Detail

getIdentifier

public String getIdentifier()
Description copied from interface: IClassByteStreamHandler
Returns the unique ID for this bytestream handler

Specified by:
getIdentifier in interface IClassByteStreamHandler
Returns:
the unique id

receiveBytes

public void receiveBytes(String className,
                         byte[] buffer,
                         int size)
Receive a class and load it. This method is called by the DataStore when the communication layer receives a class file transfer This method kicks off a new thread so that the receiver thread can be free to receive other data.

Specified by:
receiveBytes in interface IClassByteStreamHandler
Parameters:
className - the name of the class to receive
buffer - the bytes that comprise the class
size - the number of bytes in the class

receiveInstanceBytes

public void receiveInstanceBytes(byte[] buffer,
                                 int size)
Receive a class instance and load it. This method is called by the DataStore when the communication layer receives a class file transfer This method kicks off a new thread so that the receiver thread can be free to receive other data.

Specified by:
receiveInstanceBytes in interface IClassByteStreamHandler
Parameters:
buffer - the bytes that comprise the class instance
size - the number of bytes in the class instance

findStatusFor

protected DataElement findStatusFor(String remotePath)

Remote System Explorer DataStore
Release 3.3

Copyright (c) IBM Corporation and others 2000, 2011. All Rights Reserved.