How to make StringSelection Transferable Serializable?

Hi, Im trying to send a StringSelection over a RMI-network
All object sent over an RMI network must be Serializable
My problem is how do i read something that is not Serializable?
Is there anyway to access the bytecode of any object?
following code is an attempt to solve the problem
<code>
package remotecontroller.master;
import java.awt.datatransfer.Transferable;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.rmi.RemoteException;
public class ClipboardContent implements Serializable{
private transient Transferable transferable;
public ClipboardContent( Transferable transferable ) throws RemoteException{
this.transferable = transferable;
public Transferable getTransferable(){
return transferable;
private void writeObject(ObjectOutputStream out) throws IOException{
System.out.println("writeObject"+transferable);
out.defaultWriteObject();
out.writeObject( transferable );
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException{
System.out.println("readObject"+transferable);
in.defaultReadObject();
transferable = (Transferable)in.readObject();
</code>

Hi, Im trying to send a StringSelection over a RMI-network
All object sent over an RMI network must be Serializable
My problem is how do i read something that is not Serializable?
Is there anyway to access the bytecode of any object?
following code is an attempt to solve the problem
<code>
package remotecontroller.master;
import java.awt.datatransfer.Transferable;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.rmi.RemoteException;
public class ClipboardContent implements Serializable{
private transient Transferable transferable;
public ClipboardContent( Transferable transferable ) throws RemoteException{
this.transferable = transferable;
public Transferable getTransferable(){
return transferable;
private void writeObject(ObjectOutputStream out) throws IOException{
System.out.println("writeObject"+transferable);
out.defaultWriteObject();
out.writeObject( transferable );
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException{
System.out.println("readObject"+transferable);
in.defaultReadObject();
transferable = (Transferable)in.readObject();
</code>

Similar Messages

  • How to make Rectangle2D.Double serializable?

    I like to store Objects of the Class Rectangle2D ?
    It sems that they are not serializable, even if the parent Class of the parent Class is serializible, because I get the following error:
    java.io.NotSerializableException: java.awt.geom.Rectangle2D$Double
    Who can I make Rectangle2D.Double serializable? I tried this way:
    1.Create a new Class MyRectangle2D that extends Rectangle2D.Double and that implements the Interface Serializable
    2.define the following funtions:
    private void writeObject(java.io.ObjectOutputStream out)
    throws IOException{...
    and
    private void readObject(java.io.ObjectInputStream in)
    throws IOException, ClassNotFoundException{
    But what I have to write in these Methods?
    I tried to write every element x,y w and height of the rectangle seperatly.
    Thanks for your help.

    I like to store Objects of the Class Rectangle2D ?
    It sems that they are not serializable, even if the parent Class of the parent Class is serializible, because I get the following error:
    java.io.NotSerializableException: java.awt.geom.Rectangle2D$Double
    Who can I make Rectangle2D.Double serializable? I tried this way:
    1.Create a new Class MyRectangle2D that extends Rectangle2D.Double and that implements the Interface Serializable
    2.define the following funtions:
    private void writeObject(java.io.ObjectOutputStream out)
    throws IOException{...
    and
    private void readObject(java.io.ObjectInputStream in)
    throws IOException, ClassNotFoundException{
    But what I have to write in these Methods?
    I tried to write every element x,y w and height of the rectangle seperatly.
    Thanks for your help.

  • How to make a class serializable

     

    This is not a good place to learn general Java ... I suggest looking at the
    Java serialization specification from JDK1.1 (?) and understanding how
    serialization works.
    It is impossible to answer your question either 'yes' or 'no' ... by saying
    'implements serializable' it does make instances of the class serializable,
    but that does not mean that serialization will work on those instances, for
    example because the instance may have non-null non-transient fields that are
    not serializable. Further more, some of the state may not be appropriate for
    serialization (like a JDBC Connection reference ...).
    Peace,
    Cameron Purdy
    Tangosol Inc.
    << Tangosol Server: How Weblogic applications are customized >>
    << Download now from http://www.tangosol.com/download.jsp >>
    "zille9" <sdsd> wrote in message news:3bf6f272$[email protected]..
    can i make a simple java class serializable by just writing implementsserializable in its implemetation

  • How to make serializable object in webdynpro?

    Hi
    I have written the following code... when i am executing i am getting the following error..........
    <b>javax.xml.rpc.soap.SOAPFaultException: Deserialisation failed</b>
    I think is it becoz of data... how to make it serializable
         Request_Z_BAPI_CUSTOMER_CHANGE_WS_customerChangeFromData customer = new Request_Z_BAPI_CUSTOMER_CHANGE_WS_customerChangeFromData();
         ComplexType_CustomerChangeFromData complexType = new ComplexType_CustomerChangeFromData();
         ComplexType_Bapikna101 bapi = new ComplexType_Bapikna101();
         Bapikna101 bapi1 = new Bapikna101();
         bapi1.setCity("RIYAD");
         bapi1.setCountraiso("SA");
         bapi1.setCountrniso("SA");
         bapi1.setCountry("SA");
         bapi1.setCountryiso("SA");
         bapi1.setFaxNumber("12345678");
         bapi1.setFirstName("First Name");
         bapi1.setInternet("[email protected]");
         bapi1.setDateBirth("12.12.2006");
         bapi1.setLanguIso("EN");
         bapi1.setName("Name");
         bapi1.setName3("Name 3");
         bapi1.setName4("Name 4");
         bapi1.setRegion("GB");
         bapi1.setFormOfAd("Address");
         bapi1.setStreet("Street");
         bapi1.setPostlCode("12345");
         bapi1.setLangu("X");
         bapi1.setTelephone("12345678");
         bapi1.setTelephone2("12345678");
         bapi1.setCurrency("INR");
         bapi1.setCurrencyIso("INR");
         bapi1.setOnlyChangeComaddress("X");
         complexType.setCustomerNo("0000040009");
         complexType.setPiDistrChan("01");
         complexType.setPiDivision("01");
         complexType.setPiSalesorg("QNIN");
         customer._setUser("abap");
        customer._setPassword("quinnox");
         CustomerChangeFromData data = new CustomerChangeFromData();
         data.setPiAddress(bapi1);
         //bapi.setOriginalBean(bapi1);
         complexType.setOriginalBean(data);
         wdComponentAPI.getMessageManager().reportSuccess(" "+complexType.getOriginalBean().getCustomerNo());
         wdComponentAPI.getMessageManager().reportSuccess(" "+complexType.getPiAddress());
         wdContext.nodeRequest_Z_Bapi_Customer_Change().bind(customer);
         complexType.setPiAddress(bapi);
         wdComponentAPI.getMessageManager().reportSuccess(" "+data.getPiAddress().getCity());
         customer.setParameters(complexType);
    help me
    Best Regards
    Ravi Shankar B

    Hi ashuthosh,
      What is the structure of your import and Export parameters of your RFC.
    There are 2 ways to acheive it.
    In the RFC either
    1. Use a Table parameter
    2. Use a Export Structure
    If you use a Table parameter in your RFC then in your webdynpro when you import your adaptive RFC model you would get the Table as a class.
    Assume your RFC/BAPI is called "Bapi_RFC_Insert"
    write the code
    Bapi_RFC_Insert in = new Bapi_RFC_Insert();
    wdContext.nodeBAPI_RFC_Insert_InputElement().bind(in);
    <TableName> <someName> = new <TableName>
    <someName>.setTabValue1();
    <someName>.setTabValue2();
    in.add<>(<someName>);
    This should pass values as a batch.
    You can also do this using Export parameters. But a table is much better.
    Let me know if you require more information.
    regards
    ravi

  • How to make use of iPhone to do recording?

    Hi,
    how to make use of iPhone to be a recording device for vocal?

    The Voice Memos app included with the iPhone is the best and only way to make use of the iPhone for recording with included apps, which is also free since it is included by Apple with the iPhone. And recordings made with the Voice Memos app are synced with your iTunes library on your computer - transferred to your iTunes library on your computer when syncing your iPhone with iTunes.

  • I just upgraded to the new 4, but not sure how to make sure all my apps (purchases) get over to the new phone from iphone 3.  can't seem to find instructions. thanks.

    I just upgraded to the new iphone 4, but am hesitant to get it plugged in b/c I don't know how to make sure all the apps purchased on my iphone 3 get to the new phone.  can't seem to find instructions so I'm sure it just "does it", but hesitant to literally pull the plug.  thanks.

    Follow these instructions:  iPhone: Transferring information from your current iPhone to a new iPhone, http://support.apple.com/kb/ht2109

  • How to make an object mutable?

    Can any one tell me how to make an object mutable?
    Following is Class X & Y?
    class Y
    public static void main(String arg[]) {
    X a1=new X();
    Object a=a1.get();
    System.out.println(a.toString());
    a1.set(a);
    System.out.println(a.toString());
    class X implements Serializable
    public Object get(){
    return new Object();
    public synchronized void set(Object o)
    o=null;
    In my class Y when i say
    a1.set(a);
    I want local Object a of main method should be nullified.
    Can it be possible if yes what is the way or code to be applied so that
    my next a.toString() statement will give me NullpointerException.

    Isn't it more accurate to say that object references are passed by value?
    OP -- Basically you can't to what you want to do. When you "pass an object" as a method parameter, what you're really passing is a copy of the reference that points to the object. You now have two refs pointing to the same object--one in the caller and one in the method being executed. Setting either of those refs to null does NOT affect the object itself, and does NOT affect the other ref. It just means that the ref that's been set to null no longer points to any object.
    If you want the called method to make a change that the caller can see, you need to either 1) return a value from the method, 2) encapsulate the object to be changed as a member of new class, or 3) pass the object to be changed as the single element of an array. I would STRONGLY recommend against (3) as a way to simulate pass by reference. Better to examine your design and determine whether (1) or (2) more closely matches what you're really trying to accomplish.

  • How to Make Itunes Recognize Foreign Characters in file names?

    How to Make Itunes Recognize Foreign Characters in file names?
    Any Body, please
    DELL Windows XP Pro

    That's not how it's supposed to work according to this: http://www.griffintechnology.com/support/italkpro/
    By default, a playlist will be created in iTunes called "Voice Memos" and those files will be transferred there automatically. The files themselves can be found on your computer in your iTunes Music folder in Unknown Artist > Unknown Album.
    It may be worth working through any trouble shooting articles on that site.
    Regards,
    Colin R.

  • How to make a row as selected in output internal table in oops ALV

    Hi All,
    I have ALV grid output using oops ALV concept, in my output i have a checkbox as first column when i select this checkbox and press a push button 'Print' which is there above ALV grid that particular line in output table should get selected and i need to code some logic for printing selected row.
    how to make the particluar row in the output internal table to be selected and where to write the logic for print once it is pressed?
    Thanks in advance
    Srilakshmi.

    but the checkbox is not getting set in internal table when i select some checkboxes.
    can anybody explain y the checkbox in internal table not set?
    Hi Srilakshmi,
    As explained by Uwe, when we change a field ( say check box ) in ALV grid, the view (frontend) changes (showing the tick mark) but the changed data ( normally ) is not transfered to the backend.
    We can initiate this data transfer by just registering the cl_gui_alv_grid=>mc_evt_modified  edit event
      go_grid->set_table_for_first_display( CHANGING  it_fieldcatalog      = pt_fieldcat
                                                      it_outtab            = pt_outtab ).
      go_grid->set_ready_for_input( 1 ).
      go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ). " This does the trick
    Now as soon as we check a checkbox, the data_changed event is triggered.
    This initiates data transfer to the backend and the checkbox field in internal table is updated.
    check the below code for example.
    DATA: go_cont            TYPE REF TO cl_gui_custom_container,
          go_grid            TYPE REF TO cl_gui_alv_grid,
          gt_fieldcat        TYPE lvc_t_fcat,
          gv_language        TYPE spras VALUE 'E',
          gt_outtab          TYPE TABLE OF bus_loca_demo WITH HEADER LINE.
    START-OF-SELECTION.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'BASIC'.
      SET TITLEBAR  '001'.
      PERFORM create_and_init_alv CHANGING gt_outtab[]
                                           gt_fieldcat.
    ENDMODULE.                    "pbo OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'PRINT'.
          BREAK-POINT.
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
                                      pt_fieldcat TYPE lvc_t_fcat.
      CHECK go_cont IS NOT BOUND.
      CREATE OBJECT go_cont
        EXPORTING
          container_name = 'CUSTOM'.
      CREATE OBJECT go_grid
        EXPORTING
          i_parent = go_cont.
      PERFORM build_display_table.
      PERFORM build_fieldcat CHANGING pt_fieldcat.
      go_grid->set_table_for_first_display( CHANGING  it_fieldcatalog      = pt_fieldcat
                                                      it_outtab            = pt_outtab ).
      go_grid->set_ready_for_input( 1 ).
      go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ). " This does the trick
    ENDFORM.                               "CREATE_AND_INIT_ALV
    FORM build_display_table.
      FREE gt_outtab.
      DO 10 TIMES.
        gt_outtab-creation_partner = sy-index.
        gt_outtab-date_field       = sy-datum.
        APPEND gt_outtab.
      ENDDO.
    ENDFORM.                               "build_display_table
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'BUS_LOCA_DEMO'
        CHANGING
          ct_fieldcat      = pt_fieldcat.
      LOOP AT pt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'CHECKBOX'.
            ls_fcat-checkbox = 'X'.
            ls_fcat-edit     = abap_true.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'ENTER_FIELD' OR 'DBLCLICK_FIELD'.
            ls_fcat-no_out  = abap_true.
            MODIFY pt_fieldcat FROM ls_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                               "build_fieldcat
    Cheers,
    Jose.

  • TheVolumeSettings Folder: How to make it disappear

    Hi, I was transferring a large folder from my computer hard drive to an external when I noticed this folder pop up on the external hard drive. When I click on it, it disappears, but I can't seem to delete it.
    Can anyone explain to me
    1) What the Volume Settings Folder is
    2) Why it came up after tranferring the files
    3) How to make it go away again
    Thank you very much!

    Hi R&R, and a warm welcome to the forums!
    1. iirc it's for Classic/OS9.
    2. What date/time does Get info say?
    3. I'd ignore it.

  • How to make the delivery cost changeable after cancellation of GR?

    Create a PO (with Delivery cost), then GR (101) , then cancel the GR (102), but the delivery cost still cannot be modified eventhough the GR has been cancelled - how to make the delivery cost changeable after cancellation of GR?

    Hi
    "You are not allowed to add new delivery costs in a purchase order once goods receipt has been carried out as these would then be proposed in the invoice verification. The related posting to the clearing account for goods receipt and invoice receipt would not then balance, if no further goods receipt took place.
    After the invoice has been received successfully, it is not possible to change the delivery costs in the order. This is because information necessary for problem-free operation is no longer available for the delivery costs that have already been posted for subsequent reversals or invoices, or the operation can no longer be done without errors.
    It is also not possible to change delivery costs for stock transfers with SD shipping after goods have been successfully issued, as this can lead to errors during cancellation."
    I think you have to delete the line item and create a new line item with revised delivery conditions..
    MRao

  • How to delete photos transferred from mac to iphone ?

    I have searched on Google "how to delete photos transferred from mac to iPhone"
    It returned the following result :
    To do so just:
    In iTunes select the device icon in the Devices List on the left. ...
    Choose Sync photos from, being iPhoto or Aperture on a Mac and Photoshop Album or Photoshop Elements on a Windows PC.
    Choose Select Albums and deselect the albums or collections you want to delete.
    Click Apply.
    But the problem here is that I have deleted the album which I synced via iTunes on Mac.
    Now how can deleted those synced photos from my iPhone ?

    No. Hook it up to any computer running iTunes. Make sure that you do not have any of the other tabs set up to sync, so that you do not overlay the info you have on your device for Music, Movies, etc., then go the the Music tab and un-check Sync Music. This should remove all sync'd music from your device. (this is presuming that the Mac you sync with does not have any photos you do want to sync with your device. If it does have any photos you want to sync, then instead of turning off the Music syncing altogether, you can just select what you do want to sync, and the sync will remove all other sync'd albums).
    Cheers,
    GB

  • How to make stock zero

    HI,
    qty 10 exists in sales order stock (which is moved from unrestricted stock to sales order stock using mov type 412-E in MB1B)
    case1
    How to make this sales order stock  10 as zero.
    case 2
    suppose if stock in unrestricted stock in 100
    how to make stock in unrestricted stock as zero
    Pl suggest

    hi guys:
    I have a similar query, Is there any possible way to scrap the sale order stock in quality inspection without transferring it to the unrestricted stock and that also through inventory count(mi01,04,07),
    Actually we have damage lighting stock which is received against sale order(automatically transferred to quality inspection), and customers are replaced with new units, then this stock is called back in head office, for this we have a complicated process in use, first  this stock is scraped from suppose "a" storage location after transferring it to unrestricted, then loaded back to "a", to make an STR for it from Head Office.
    So is there any way to scrap all special stock(complete storage location) against different sale orders at one go. whether the stock is available in unrestricted, quality inspection or blocked stock.
    I hope I am understood.
    Please help me to get through this complicated process.
    Regards
    Salar...

  • How to make the GL accounts as CO-PA Relevant

    Dear Gurus,
    Please let me know how to make the GL accounts as CO-PA relevant, we need to book the sale provision
    Regards
    VSK

    Hi,
    Assignment of SD Condition Types to Value Fields: T Code KE4I
    1. To transfer condition types for sales revenues and sales deductions to COPA, you need to make sure that the condition types and linked to an account in FI that is also defined as a cost element of the category "11" (revenue element) or "12" (sales deduction) in CO. These condition types must be assigned to a CO-PA value field. Condition types linked to FI accounts that are defined as cost elements of another category are not transferred to CO-PA, even when the condition type has been assigned to a CO-PA value field.
    2. Condition types such as "VPRS" ("Cost") that are defined as statistical in SD are always transferred to CO-PA if they are assigned to a value field.
    3. All condition types that you want to transfer to CO-PA must be active in the SD pricing
    Thanks and Regards
    Binoj M D

  • How can make consolidation balance sheet

    how can make consolidation chart of account.
    Moderator: With a bit of research

    In simple terms, I would say that if you have define a group chart of accounts, you can get a consolidated report by preparing a financial statement version based on Group chart of accounts.  Define the group chart of accounts (in the same line as you define operative chart of accounts) and assign the group chart of accounts in the operative chart of accounts.  You can create GL accounts in group of chart of accounts for making entries on a consolidation base.  Once you do this while creating the GL accounts in FS00, you will have an additional field of account number in Group chart of accounts.  There you can give the GL account number created in the group chart of accounts.  So whenever you make a posting to your individual company code GL accounts, the same will also get updated in the group chart of account GL account number. 
    I hope you have got a flair of things now..  Nevertheless, by simply proceeding in this line is not enough to have a true picture of things from the group point of view.  There may be other things to consider like elimination of inter-company profits, losses, transfers, etc.  For this purpose, you will have to go for additional installations like SEM-BCS, BI, etc.

Maybe you are looking for

  • My Macbook pro was stolen before I had time to register it and I want to inform apple

    My MacBook pro was stolen two days after I purchased it. I did not register my product nor did I have time to set up any tracking software. I still have the box and the registration/Serial Number. How can I inform Apple in hopes that they can help me

  • Scanned photos are not in proper date order

    I have photos that I am scanning & importing into iPhoto6, but iPhoto sorts them by import date. I want them to be sorted by modified date (I think). I have read on this forum similar problems & solutions, but as yet cannot seem to find a solution th

  • Mac os

    I am considering a mac mini and have had a windows computer all of my life so i am wondering a few things about the mac software itself: Ive read about no viruses, can i still browse the web with my cable connection? and if so how does it not have an

  • Display the report in dashboard by using CSS

    Hi Expects, I am using Display:None in CSS Option,it shows that the report is Minimize until we expand it.My question is,if when we give the conditions in filter and click apply the report is again minimize,hear i need to do that when we give the con

  • Cheap and worthless photo.app program

    How?! How it was possible on to treat the buyer so many devil-may-carely?! People, for years bought your production, kept the most high points, saved, edited and sorted the photos, and not on 1 gigabyte! How it was possible, it is simple to take and