Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66284 Details for
Bug 150217
Feature request: add BaseAgent.sendData(int, byte[]) in Java API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Introduce SendData(int, byte[]) Java implementation
sendData_execution.patch (text/plain), 4.83 KB, created by
Stanislav Polevic
on 2007-05-08 09:45:17 EDT
(
hide
)
Description:
Introduce SendData(int, byte[]) Java implementation
Filename:
MIME Type:
Creator:
Stanislav Polevic
Created:
2007-05-08 09:45:17 EDT
Size:
4.83 KB
patch
obsolete
>Index: src/org/eclipse/tptp/platform/execution/datacollection/BaseAgent.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.execution/src/org/eclipse/tptp/platform/execution/datacollection/BaseAgent.java,v >retrieving revision 1.15 >diff -u -r1.15 BaseAgent.java >--- src/org/eclipse/tptp/platform/execution/datacollection/BaseAgent.java 10 Feb 2006 21:54:13 -0000 1.15 >+++ src/org/eclipse/tptp/platform/execution/datacollection/BaseAgent.java 26 Apr 2007 13:10:59 -0000 >@@ -135,6 +135,11 @@ > private native int sendData0(int targetInstanceId, char[] buffer, int bufferLength); > > /** >+ * Native function for sending data >+ */ >+ private native int sendData1(int targetInstanceId, byte[] buffer, int offset, int length); >+ >+ /** > * Native function for sending a command to the Agent Controller > */ > private native int sendCommand0(String command) throws InactiveAgentException; >@@ -312,6 +317,27 @@ > if(response == -1){throw new AgentControllerUnavailableException(Constants.TPTP_PLATFORM_EXEC_MSG43);} > return response; > } >+ >+ /** >+ * @see IBaseAgent#sendData(int, byte[]) >+ */ >+ public int sendData(int targetInstanceId, byte[] buffer) throws AgentControllerUnavailableException { >+ return sendData (targetInstanceId, buffer, 0, buffer.length); >+ } >+ >+ /** >+ * @see IBaseAgent#sendData(int, byte[], int, int) >+ */ >+ public int sendData(int targetInstanceId, byte[] buffer, int offset, int length) throws AgentControllerUnavailableException { >+ if (buffer == null) return 0; >+ if (offset > length) >+ throw new IllegalArgumentException("Offset should not exceed array length"); >+ >+ int response = this.sendData1(targetInstanceId, buffer, offset, length); >+ if(response == -1){throw new AgentControllerUnavailableException(Constants.TPTP_PLATFORM_EXEC_MSG43);} >+ return response; >+ } >+ > /** > * @see IBaseAgent#receiveData(int, char[], int) > */ >@@ -325,6 +351,13 @@ > return 0; > } > >+ /** >+ * @see IBaseAgent#receiveData(int, char[], int) >+ */ >+ public int receiveData(int sourceId, byte[] buffer, int bufferLength) throws AgentControllerUnavailableException { >+ System.out.println(String.valueOf(bufferLength) + " bytes recvd. on the data channel"); >+ return 0; >+ } > > /** > * @see IAgent#getName() >Index: src/org/eclipse/tptp/platform/execution/datacollection/IBaseAgent.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.execution/src/org/eclipse/tptp/platform/execution/datacollection/IBaseAgent.java,v >retrieving revision 1.14 >diff -u -r1.14 IBaseAgent.java >--- src/org/eclipse/tptp/platform/execution/datacollection/IBaseAgent.java 10 Feb 2006 21:54:13 -0000 1.14 >+++ src/org/eclipse/tptp/platform/execution/datacollection/IBaseAgent.java 26 Apr 2007 13:11:00 -0000 >@@ -82,6 +82,30 @@ > //public int sendData(int targetInstanceId, char[] buffer, int bufferLength) throws DataChannelConnectionException, NotConnectedException; > public int sendData(int targetInstanceId, char[] buffer) throws DataChannelConnectionException, AgentControllerUnavailableException; > /** >+ * send the given data buffer to the given destination >+ * This method is used by the Remote Agent >+ * on the AgentController to send the data to the Client >+ * @param targetInstanceId - send data to the target connection id >+ * @param buffer - data to be sent >+ * @throws DataChannelConnectionException >+ * @return 0 successful; non-zero error >+ */ >+ public int sendData(int targetInstanceId, byte[] buffer) throws AgentControllerUnavailableException; >+ >+ /** >+ * send the given data buffer to the given destination >+ * This method is used by the Remote Agent >+ * on the AgentController to send the data to the Client >+ * @param targetInstanceId - send data to the target connection id >+ * @param buffer - data to be sent >+ * @param offset - start offset in the data >+ * @param length - number of bytes to send >+ * @throws DataChannelConnectionException >+ * @return 0 successful; non-zero error >+ */ >+ public int sendData(int targetInstanceId, byte[] buffer, int offset, int length) throws AgentControllerUnavailableException; >+ >+ /** > * ReceiveData from the Client > * @param sourceId > * @param buffer >@@ -90,6 +114,15 @@ > */ > public int receiveData(int sourceId, String buffer, int bufferLength) throws DataChannelConnectionException, AgentControllerUnavailableException; > >+ /** >+ * ReceiveData from the Client >+ * @param sourceId >+ * @param buffer >+ * @param bufferLength >+ * @throws DataChannelConnectionException, NotConnectedException >+ */ >+ public int receiveData(int sourceId, byte[] buffer, int bufferLength) throws DataChannelConnectionException, AgentControllerUnavailableException; >+ > /** > * This method is invoked by the Agent Controller if there are no referencing clients > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 150217
:
66283
| 66284