Non-string objects as parameters to an applet

how can i pass non-string objects as parameters to an applet?
thanks in advance...

those are some objects that i wroteThen, you could use Class.forName() method for your string parameters.
If you get the classes, then you can call newInstance() method on them to get objects.
Alternative way could be using your string parameter as index or keys for some
data structures that contains ready-made objects.

Similar Messages

  • Specifying Non-String User Parameters in The Block Comment Dialog Tag

    I am trying to add user parameters for a block. I followed the instruction provided in section 4.3.7 (comments) of sysytembuild user's guide.
    The steps were as follows:
    1- I added a new parameter named (a_r) to a gain block (from the User Parameters section of Comment tag dialog field).
    2- I selected this parameter and assigned a value of 5
    Now, using the SBA command I retrieve this parameter:
    ------------------------------- Xmath outputs
    [n=UserParameterName, p=UserParameterContent] = queryblock(1)
    n
    n (a string) = a_r
    p
    p (a list with 1 elements) =
    1:
    5
    p(1)
    ans (a string) = 5
    ---------------------------- end of Xmath outputs
    Accordin
    g to the documentation, using suffix (_r) will specify a real parameter (_i for integer and _s for string). However, the list object
    obtained from "UserParameterContent" includes a string element and not a number. This can be verified by:
    --------------------------------------- Xmath outputs
    p(1) *2
    Cannot evaluate * of a string.
    modifyblock 1 ,{UserParameterContent = list(5)}
    Expecting a list of strings
    --------------------------------- end of Xmath outputs
    It looks like that independent of the naming convention, the user parameters are stored in a list with string elements in contrast to what
    mentioned in "Editing User Parameters Dialog" of the Help topics:
    "To create a new userparameter, enter a name in the User Defined field, and then click the Add button. Note that the name must have
    one of the following suffixes: _s (string), _b (boolean), _r (real), or _i (integer). "
    The questions are as follows:
    1- Is there a way to store n
    on-string type user parameters?
    2- If there is a way for that, then, is it only for scalar numeric values or vectors and matrices can also be stored in user parameters?
    Thanks,

    The Comments Tab is generally used to define User Parameters that will be used with DocumentIt. The suffix (_s, _b,_r, etc) is to designate the datatype for DocumentIt.
    All user parameters will be passed as string data to Xmath. As you noted the value 5 is passed as a string. To convert this to a scalar use the makematrix command. After you assign a value of 5 to the a_r user parameter use the SBA command queryblock as follows:
    n=UserParameterName, p=UserParameterContent] = queryblock(1)
    then enter
    m=makematrix(p(1))
    this will return a scalar.
    To get a vector in Xmath from the User Parameters you must assign the values differently on the Comment tab. Define a user parameter and assign its values by entering a carriage return after each element.
    For example assign the following value to user paramter a_r:
    5
    6
    7
    8
    Using the queryblock command you should now get:
    p(1) is a column vector of strings
    again use the makematrix command to convert this to a vector of scalars.
    m1=makematrix(p(1))
    Matrices will require a different user parameter for each column of the matrix. For example to add a column to the previous vector, you will need to go to the user parameters and add a new parameter (call it b_r) assign its values with the carriage return after each element for example:
    0
    1
    2
    3
    Again use the queryblock command. Now p will have 2 elements (one for each parameter). To create a matrix enter:
    m2=makematrix([p(1),p(2)])
    NOTE: The order the user parameters were entered in the Comment Tab will not necessarily correspond to the element they return as when using the queryblock. For example from the previous procedure, do not assume the second user parameter entered (b_r) is going to be returne
    d as p(2).

  • Issue with passing parameters to an applet?

    Hi,
    I have an apex page which is a popup page. I am passing parameters to the applet and then reading them in from my java code.
    Here is my applet code
    <SCRIPT>
      function getStatus(retStatus) {
        $s("P3_MESSAGE", ''||retStatus||'')
    </SCRIPT>
    <APPLET ARCHIVE="/i/bin/offline_load.zip" CODE="offline_load.class"  STATUSMSG WIDTH=0 HEIGHT=0>
    <PARAM name="username" value="&APP_USER.">
    <PARAM name="dbuser" value="&P3_DBUSER.">
    <PARAM name="dbpassword" value="&P3_DBPASSWORD.">
    <PARAM name="dbserver" value="&P0_DBSERVER.">
    <PARAM name="dbport" value="&P3_DBPORT.">
    <PARAM name="dbsid" value="&P3_DBSID.">
    </APPLET>P3_DBUSER, P3_DBPASSWORD, etc are all defined on page zero as hidden and protected items
    My applet code
    public void init() {
        CallableStatement load_stmt = null;
        String userName = this.getParameter("username");
        String dbUser = this.getParameter("dbuser");
        String dbPass = this.getParameter("dbpassword");
        String dbServer = this.getParameter("dbserver");
        String dbPort = this.getParameter("dbport");
        String dbSid = this.getParameter("dbsid");
        try {
          System.out.println("init(): loading OracleDriver for applet created at " + created.toString());
          Class.forName("oracle.jdbc.driver.OracleDriver");
          System.out.println("init(): getting connection");
          conn = DriverManager.getConnection("jdbc:oracle:thin:@" + dbServer + ":" + dbPort + ":" + dbSid, dbUser, dbPass);
        } // end tryThe odd thing is I have gotten this working twice then unexpectedly it just stops working when I make a change to the java applet code.
    And the changes have absolutely nothing to do with the above code it can be anything the first time was error handling I added
    to another section and the second I modified a stored procedure call.
    Anyone have any idea why this might be occurring as this is driving me completely insane :(
    Thanks in advance

    Hi,
    In your init() code, you have a "try" block - do you have a "finally" block to close the connection? Something like:
    finally {
      try {
        conn.close();
      catch (Exception ignore) {
    }Could it be that you have reached the limit of the number of available open connections?
    Your code looks ok as far as I can see (based on examples at: http://www.orafaq.com/wiki/JDBC )
    Also, in your new bits of code, have you added try/catch/finally blocks? Does the code compile fully (ie, no warnings)? Have you added new imports that may conflict with existing code such that you have to fully qualify existing objects/classes (eg, you may now have two DriverManager classes or CallableStatement objects)?
    Andy

  • Passing input parameters from an applet to a JSP page

    Hello all,
    Yes, its one of these questions which I have tried to find a solution from the already large number of postings but with no luck. I'm still a novice to Java/JSP so bear with me.
    Consider this scenario.
    1. An applet which has two input boxes (say First name and surname). 2. These parameters will be passed to a JSP page (so the applet will call a JSP page).
    3. The JSP will have have the necessary logic (or actually a JavaBean will) to connect to a database and add a new record with these parameters (first name and surname).
    I also need to consider editing/updating the record in the database. So a JSP page will connect to the database, retrieving the required record from the database and then display the parameters back in an applet in two input boxes (first name and surname) to be edited and saved again.
    I have been able to develop a similar application using simple HTML forms to add and update records in a database so I'm not worried about the database connectivity simply the issue of passing parameters from the applet to the JSP page and vice versa (for edit/update).
    Once i've managed to do this with input boxes, I can experiment with the other input types radios, checkboxes, select etc.
    Many thanks in advance,
    Assad

    create an URL object with u'r specified link of the java class and send the parameters..write trhis action in any buttonclick event in u'r applet.

  • How to manage non-SAP objects types with SAP Netweaver ?

    I would like to know how it is possible to integrate into the SAP software configuration managment tools (NWDI CTS, CTS+...) non-SAP objects like shell scripts or SQL requests ?
    These shell scripts are, for example:
    - external host scheduler jobs
    - general scripts for start/stop application
    - parameters needed by application at the os level
    My goal should to store into a DEV SAP system these objects, in order to take benefit of SE80 version management. So, it should be possible to create transport order in SE10 and to transport these non-SAP objects in test and production system.
    Thank in advance for your answers.
    Daniel Ouin

    the standard functionality for this up until 4.72 is to call RFCs/BAPIs through a RFC binding library for the third party software, e.g. the language of your choice is PHP then you use the PHP RFC library found [here|http://saprfc.sourceforge.net/], if you have to connect from a .NET environment you might try to get the SAP .NET connector.
    anton
    PS: RTFM and/or using the search facilities here on SCN would help you a lot with your task.

  • Serialializing non serializable objects

    Hi guys,
    I have to serialize (and then send through socket) a class which implements java.io.Serializable. This class also has some reference with other classes, which should be serialized togheter.
    But when I run the main class (which only serializes) , java.io.NotSerializableException is thrown.
    How do I recognize if a class is effectively serializable?
    How do I serialize too even with non-serializable objects?
    (I need all these objects)
    note : In the class I have only put the marker "implements java.io.Serializable",should I have to do somenthing else?
    Thank You for your great help!

    Hi guys,
    I have to serialize (and then send through socket)a
    class which implements java.io.Serializable. This
    class also has some reference with other classes,
    which should be serialized togheter.
    But when I run the main class (which onlyserializes)
    , java.io.NotSerializableException is thrown.
    How do I recognize if a class is effectively
    serializable?
    How do I serialize too even with non-serializable
    objects?
    (I need all these objects)
    note : In the class I have only put the marker
    "implements java.io.Serializable",should I have todo
    somenthing else?
    Thank You for your great help!I wish there was a utility that could inspect a
    Class, traverse its containment tree and flag
    serializability issues. This could be more powerful
    if generics are used.
    To solve your problem besides the marker, implement
    methods writeObject and readObject and serializing
    the contained object that is not serializable by
    hand. For example if your class is X which contains Y
    that is not serializable then you need to serialize
    fields Y in X.writeObject and construct a Y object in
    X.readObject:
    class Y { // not serializable and you cannot modify
    it
    int i;
    int j;
    Y(int i, int j)
    class X implements Serializable {
    String xyz;
    Y y;
    private void writeObject(ObjectOutputStream out)
    throws IOException{
    out.writeObject(xyz);
    out.writeInt(y.getI());
    out.writeInt(y.getJ());
    private void readObject(ObjectInputStream in)
    throws IOException{
    xyz = (String) in.readObject();
    int i = in.readInt();
    int j = in.readInt();
    y = new Y(i, j);Remember to maintain the same order in readObject and
    writeObject.
    Hi guys,
    I have to serialize (and then send through socket)a
    class which implements java.io.Serializable. This
    class also has some reference with other classes,
    which should be serialized togheter.
    But when I run the main class (which onlyserializes)
    , java.io.NotSerializableException is thrown.
    How do I recognize if a class is effectively
    serializable?
    How do I serialize too even with non-serializable
    objects?
    (I need all these objects)
    note : In the class I have only put the marker
    "implements java.io.Serializable",should I have todo
    somenthing else?
    Thank You for your great help!I wish there was a utility that could inspect a
    Class, traverse its containment tree and flag
    serializability issues. This could be more powerful
    if generics are used.
    To solve your problem besides the marker, implement
    methods writeObject and readObject and serializing
    the contained object that is not serializable by
    hand. For example if your class is X which contains Y
    that is not serializable then you need to serialize
    fields Y in X.writeObject and construct a Y object in
    X.readObject:
    class Y { // not serializable and you cannot modify
    it
    int i;
    int j;
    Y(int i, int j)
    class X implements Serializable {
    String xyz;
    Y y;
    private void writeObject(ObjectOutputStream out)
    throws IOException{
    out.writeObject(xyz);
    out.writeInt(y.getI());
    out.writeInt(y.getJ());
    private void readObject(ObjectInputStream in)
    throws IOException{
    xyz = (String) in.readObject();
    int i = in.readInt();
    int j = in.readInt();
    y = new Y(i, j);Remember to maintain the same order in readObject and
    writeObject.

  • Non Serializable Objects

    I am working on a java project and I have to serialize a class (created by me) which has many references to other classes that should be serialized too.
    I add the marker "implements serializable" to all the necessary classes, but when I run I get a non serializable exception.
    Maybe one ore more objects are non serializable, but how do I identify them?
    I've read that If I have to serialize non serializable objects, I need to write my own writeObject(ObjectOutputStream out)throws IOException and readObject(ObjectInputStream in) , but I don't know how to implement and us them.
    note : I can't use transient beacuse I need everything to be serialized!
    Thanks a lot. Bye!

    Now I'll post my code, If anyone knows how to serialize (and then deseserialize) the class "AgentMessage" , and its subclasses "StaticPart" and "DynElement" from the main class , I'll be grateful.. It's about 2 days I'm working on it and I continue getting "nonserialializable exception" ...
    thank you guys
    package agentsLibrary;
    //some imports
    public class AgentMessage implements Serializable{
         private static final long serialVersionUID = 1L;
         private StaticPart sp;
         private DynElement de;
         public AgentMessage(String agent,byte[] code,String mainclass,Certificate signerId,PrivateKey priv,String configuration,Serializable dclear,byte[] dsecret,PathEl[] dpath,byte[] c){ //costruttore
              sp=new StaticPart(agent,code,mainclass,signerId,priv,configuration);
              de=new DynElement(dclear,dsecret,c,dpath);
         public StaticPart getSp(){
              return sp;
         public DynElement getDe(){
              return de;
         private void writeObject(java.io.ObjectOutputStream out) throws IOException{
              System.out.println("class implements writeObject( )");
              //depends on the method to store out all the important state
              //out.defaultWriteObject();//perform the default serialization(va sempre fatto il default)
              out.writeObject(sp);
              out.writeObject(de);
         private void readObject(java.io.ObjectInputStream in)throws ClassNotFoundException, IOException {
              System.out.println("class implements readObject( )");
              //in.defaultReadObject();
              sp=(StaticPart)in.readObject();
              de=(DynElement)in.readObject();
    package agentsLibrary;
    public class StaticPart implements Serializable{
         private static final long serialVersionUID = 1L;
         private String agent="";
         private byte[] code=null;
         private String mainclass="";
         private Certificate signerid=null;
         private PrivateKey priv=null;
         private Calendar timestamp=null;
         private Signature sig=null;
         private byte[] buffertotale=null;
         private byte[] firma=null;
         private String configuration="";
         public StaticPart(String agent, byte[] code, String mainclass, Certificate signerid, PrivateKey priv,String configuration){
              this.configuration=configuration;
              this.code=code;
              this.mainclass=mainclass;
              this.agent=agent;
              this.priv=priv;
              this.signerid=signerid;
              timestamp=Calendar.getInstance();
              Date time=new Date();
              time=timestamp.getTime();//Gets this Calendar's current time.
              try {
                   byte[] nomeagent=agent.getBytes("8859_1");//converto stringa
                   byte[] mainclas=mainclass.getBytes("8859_1");//converto stringa
                   byte[] signer=signerid.getEncoded();
                   byte[] priva=priv.getEncoded();
                   byte[] dat=null;
                   dat=time.toString().getBytes("8859_1");
                   buffertotale=new byte[nomeagent.length+mainclas.length+signer.length+priva.length+dat.length+code.length];
                   System.arraycopy(nomeagent, 0, buffertotale, 0, nomeagent.length);
                   System.arraycopy(code, 0, buffertotale, nomeagent.length, code.length);
                   System.arraycopy(mainclas, 0, buffertotale, code.length, mainclas.length);
                   System.arraycopy(signer, 0, buffertotale, mainclas.length, signer.length);
                   System.arraycopy(priva, 0, buffertotale, signer.length, priva.length);
                   System.arraycopy(dat, 0, buffertotale, priva.length, dat.length);
              } catch (UnsupportedEncodingException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (CertificateEncodingException e) {
                   e.printStackTrace();
                   System.exit(1);
              try {
                   sig = Signature.getInstance(priv.getAlgorithm());
                   sig.initSign(priv);
                   sig.update(buffertotale, 0, buffertotale.length);
                   firma=sig.sign();
              } catch (SignatureException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (InvalidKeyException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (NoSuchAlgorithmException e) {
                   e.printStackTrace();
                   System.exit(1);
         public boolean verify() {
              try{
                   PublicKey pub=signerid.getPublicKey();
                   Signature sig = Signature.getInstance(pub.getAlgorithm());
                   sig.initVerify(pub);
                   sig.update(buffertotale, 0, buffertotale.length);
                   return sig.verify(firma);
              } catch (SignatureException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (InvalidKeyException e) {
                   e.printStackTrace();
                   System.exit(1);
              } catch (NoSuchAlgorithmException e) {
                   e.printStackTrace();
                   System.exit(1);
              return false;
         public String getAgentName() {
              return agent;
         public byte[] getCode() {
              return code;
         public String getClassName() {
              return mainclass;
         public PrivateKey getPrivate() {
              return priv;
         public Certificate getId() {
              return signerid;
         public byte[] getSignature(){
              return firma;
         public String getConfiguration(){
              return configuration;
    package agentsLibrary;
    import java.io.Serializable;
    public class DynElement implements java.io.Serializable{
         private static final long serialVersionUID = 1L;
         private Serializable dclear=null;
         private byte[] dsecret=null;
         private PathEl[] dpath=null;
         private byte[]c=null;
         public DynElement(Serializable dclear,byte[] dsecret,byte[]c,PathEl[] dpath){
              this.dclear=dclear;
              this.dsecret=dsecret;
              this.c=c;
              this.dpath=dpath;
         public byte[] getC() {
              return c;
         public Serializable getDclear() {
              return dclear;
         public PathEl[] getDpath() {
              return dpath;
         public byte[] getDsecret() {
              return dsecret;
    //finally the following is the main class that should serialize
    AgentMessage msg=new AgentMessage(name,code,mainclass,signerId,privata,configuration,dclear,dsecret,dpath,c);
              try {
                   System.out.println("Sending Agent Message to Server "+ip+":"+port);
                   Socket s = new Socket(ip,port);
                   ObjectOutputStream out=new ObjectOutputStream(s.getOutputStream());
                   out.writeObject(msg);
                   out.flush();
                   s.close();
              } catch (Exception e) {
                   return false;
              return true;
         }

  • Non-Serializable objects in webservice

    Hi everyone,
    I'm writing a webservice that connects and performs update on a third-party
    data repository (document management system) through the vendor provided
    framework.
    Some of the objects used in the framework are not serialized, and WebLogic
    Workshop 7.0 won't compile my services because they contain non-serializable
    objects. Those objects are not used as messages or method parameters, rather
    are the member variables of the services.
    My question is how would I go about using non-serialized objects in a
    webservice class with WebLogic Workshop 7.0? I've seen some Apache AXIS
    webservice examples that does the similar thing, but some of the services
    works with non-serializable objects. Do I need to create an EJBcontrol that
    masks non-serializable objects to be used with the webservice?
    Any input is greatly appreciated. I'm still new at webservice programming.
    Thank you,
    Makoto

    Hi everyone,
    I'm writing a webservice that connects and performs update on a third-party
    data repository (document management system) through the vendor provided
    framework.
    Some of the objects used in the framework are not serialized, and WebLogic
    Workshop 7.0 won't compile my services because they contain non-serializable
    objects. Those objects are not used as messages or method parameters, rather
    are the member variables of the services.
    My question is how would I go about using non-serialized objects in a
    webservice class with WebLogic Workshop 7.0? I've seen some Apache AXIS
    webservice examples that does the similar thing, but some of the services
    works with non-serializable objects. Do I need to create an EJBcontrol that
    masks non-serializable objects to be used with the webservice?
    Any input is greatly appreciated. I'm still new at webservice programming.
    Thank you,
    Makoto

  • Collection of non-persistent objects

    Greetings
    Is it possible to persist a Collection of non-persistent objects through the
    kodo externalization feature? The non-persistent objects themselves are
    externalizable, but I don't know how I would go about persisting a
    Collection of them.
    ..droo.

    If you store them in some sort of externalized form in a single column it is
    easy - just use externalization framework to ext and de-ext them to anf from
    string. Couple of caveats you need to be aware of If your collection objects
    are mutable:
    1. You need to durty your collection field so it get prsisted on commit
    2. on rollback Kodo will restore you collection content but not collection
    member content. If they are mutable you will have to make their class
    persistent with mapping "none" so they participate in transaction
    "Drew Lethbridge" <[email protected]> wrote in message
    news:BD0B44BF.544%[email protected]..
    Greetings
    Is it possible to persist a Collection of non-persistent objects throughthe
    kodo externalization feature? The non-persistent objects themselves are
    externalizable, but I don't know how I would go about persisting a
    Collection of them.
    .droo.

  • Unable to read big files into string object  and java.lang.OutOfMemory Prob

    Hi All,
    I have an application that uses applet and servlet communication. On the client side I am reading an large xml file of 12MB size (using JFileChooser) and converting the file to an string object using below code. But I am getting java.lang.OutOfMemory on the client side . But the same below code works fine for small xml files which are less than 4MB sizes:
    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF8"), 1024*12);
    String s, s2 = new String();
    while((s = in.readLine())!= null)
         s2 += s + "\n";
    I even tried below code but still java.lang.OutOfMemory is coming:
    while (true)
         int i = in.read();
         if (i == -1)
              break;
         sb.append(i);
    Please let me know what am I doing wrong here ...
    Thanks & Regards,
    Sony.

    Using a String is bad for the following reason:
    When you initially create the String, it has a certain memory size (allocated length if you will). As you keep appending to this String, then memory reallocation will occur over and over, slowing your program down dramatically (ive seen with a 16k x 8 Char file taking 30 secs to read into memory using Strings in this way)
    A Better way would be if you knew the number of characters in the XML file (Using some File size method for example) Then you can use a StringBuffer, which will pre allocate enough space (or try to, it may just be that you cannot create a string as large as you need). You can use toString() method to get the resultant in a String Object (the extra allocated space at the end of the Buffer will be removed)
    StringBuffer strBuf = new StringBuffer(xxxx);
    Where xx is the length (int). Assuming that you are only allowed to enter an int to the constructor then (platform depedant) an int is 2^31 at maximum (or whatever) which allows 2.14e9 characters, therefore an xml file being totally filed would allow a size of ~2048 MB to be read in.
    Try it and see.

  • Unable to read big files into string object & java.lang.OutOfMemory Problem

    Hi All,
    I have an application that uses applet and servlet communication. On the client side I am reading an large xml file of 12MB size (using JFileChooser) and converting the file to an string object using below code. But I am getting java.lang.OutOfMemory on the client side . But the same below code works fine for small xml files which are less than 4MB sizes:
    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF8"), 1024*12);
    String s, s2 = new String();
    while((s = in.readLine())!= null)
    s2 += s + "\n";
    I even tried the below code but still java.lang.OutOfMemory is coming:
    while (true)
    int i = in.read();
    if (i == -1)
    break;
    sb.append(i);
    Please let me know what am I doing wrong here ...

    Hi,
    I could avoid the java.lang.OutOfMemory error using below code. But using below code I could read small files of sizes less than 4MB
    but with large files of 12 MB the below code just simply hangs and I am unable to print the string object namely 's'.
    My purpose is to construct an String or StringBuffer object out the user uploaded xml file at the client side and pass that object to server for processing. So how can I construct such object avoid memory problem and increasing the performance of such operations.
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
    byte[] b = new byte[in.available()];
    in.read(b, 0, b.length);
    String s = new String(b, 0, b.length);
    in.close();
    Thanks & Regards,
    Sony.

  • Static object vs non-static object......

    What is the purpose of static object????
    is there any example showing that the advantage of declaring a static object rather than a non-static object??
    secondly, why static object/primitive data is initialized before non-static object/primitive data?
    apreciate for any respond

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Random;
    public class Test3 extends JFrame {
      JDesktopPane jdp = new JDesktopPane();
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        content.add(jdp, BorderLayout.CENTER);
        JButton jb = new JButton("New Thingy");
        content.add(jb, BorderLayout.SOUTH);
        jb.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            try { jdp.add(new Thingy(jdp.getWidth(), jdp.getHeight())); }
            catch (Exception e) { System.out.println(e.getMessage()); }
        setSize(300, 300);
        setVisible(true);
      public static void main(String[] args) { new Test3(); }
    class Thingy extends JInternalFrame {
      Random r = new Random();
      static int count=0; //  HERE IT IS!!!
      public Thingy(int w, int h) throws Exception {
        if (count==6) throw new Exception("Too Many Thingies");
        setTitle("T-"+(++count));
        setBounds(r.nextInt(w-100),r.nextInt(h-50),100,50);
        setVisible(true);
    }

  • Objects as parameters in IDL????

    When I write my IDL files I have methods that will take objects (other remote corba object references) as parameters.
    How do I state that the parameter is going to be an object reference?
    Any help in this would be greatly appreciated...
    Best Regards,
    George Darragh
    **********One of my many errors (:-) is**********
    CORBAServer.java:206: DBClientServant should be declared abstract; it does not define getInsertClientSQL(java.lang.String) in DBClientApp._DBClientImplBase
    class DBClientServant extends _DBClientImplBase {
    ^
    **********The IDL I have relevant to this is**********
    module DBClientApp{
         interface DBClient {
              string getInsertClientSQL(in string InClient ); <-- objects as parameters
              string getUpdateClientSQL(in string InClient); <-- objects as parameters
              string getDeleteClientSQL(in long ClientID);
              string getClientUsingID(in long ClientID);
              string getallClients();
              string getallClientIDs();
    };

    hi,
    check this code out..i am using objects and callback clients..
    typedef sequence<double> value;
    /* these are the methods availbale to server to invike on client*/
    interface frequencies{
    value freq(in value num,in long f);
    void shutdown();
    /* once client starts up, it registers the object with server */
    interface Eigen{
    void addClient(in frequencies obj);
    this should help you out..
    ls

  • String object Confussion

    Given the following,
    13. String x = new String("xyz");
    14. y = "abc";
    15. x = x + y;
    how many String objects have been created?
    A. 2
    B. 3
    C. 4
    D. 5

    Line 13 creates two String objects: the constant "xyz" and the "new String".
    Line 14 creates one String object, the constant "abc".
    Line 15 creates one String object for theOne could argue that "xyz" and "zbc" exist in the constant pool and are created no later than the class that contains this code. Therefore line 13 creates only one String and line 14 none.

  • Why String Objects are immutable ?

    From the JLS->
    A String object is immutable, that is, its contents never change, while an array of char has mutable elements. The method toCharArray in class String returns an array of characters containing the same character sequence as a String. The class StringBuffer implements useful methods on mutable arrays of characters.
    Why are String objects immutable ?

    I find these answers quite satisfying ...
    Here's a concrete example: part of that safety is ensuring that an Applet can contact the server it was downloaded from (to download images, data files, etc) and not other machines (so that once you've downloaded it to your browser behind a firewall, it can't connect to your company's internal database server and suck out all your financial records.) Imagine that Strings are mutable. A rogue applet might ask for a connection to "evilserver.com", passing that server name in a String object. The JVM could check that this server name was OK, and get ready to connect to it. The applet, in another thread, could now change the contents of that String object to "databaseserver.yourcompany.com" at just the right moment; the JVM would then return a connection to the database!
    You can think of hundreds of scenarios just like that if Strings are mutable; if they're immutable, all the problems go away. Immutable Strings also result in a substantial performance improvement (no copying Strings, ever!) and memory savings (can reuse them whenever you want.)
    So immutable Strings are a good thing.
    The main reason why String made immutable was security. Look at this example: We have a file open method with login check. We pass a String to this method to process authentication which is necessary before the call will be passed to OS. If String was mutable it was possible somehow to modify its content after the authentication check before OS gets request from program then it is possible to request any file. So if you have a right to open text file in user directory but then on the fly when somehow you manage to change the file name you can request to open "passwd" file or any other. Then a file can be modified and it will be possible to login directly to OS.
    JVM internally maintains the "String Pool". To achive the memory efficiency, JVM will refer the String object from pool. It will not create the new String objects. So, whenever you create a new string literal, JVM will check in the pool whether it already exists or not. If already present in the pool, just give the reference to the same object or create the new object in the pool. There will be many references point to the same String objects, if someone changes the value, it will affect all the references. So, sun decided to make it immutable.

Maybe you are looking for

  • Button activation

    I am embarrassed to ask this question. But how do you activate a button that is embedded in a movie clip? Do you use the linkage properties to export for ActionScript or is there another way? Gizay

  • Is there an app that controls individual app volumes?

    I need to control the individual volumes of my running apps--not so much to fine-tune the volumes, but to mute specific apps. Rogue Amoeba's Detour was a champ at this, but it has been deprecated since the Intel switch. Is there anything else out the

  • XI Server Proxy Or Enterprise Service

    I need to call a BAPI in R/3  using XI. Possible Approaches:  1) Using RFC Adapter :  Performance Inferior (I do not want to discuss this) 2) Using Server Proxy  and calling the BAPI inside the method. 3) Exposing the BAPI as ES and consuming that us

  • SmartView and File not found: HsAddin

    Hello Guys, I have reinstalled SmartView twice and done the following trick as well: 1.Copy the HsAddIn.dll, HsSpread.dll, HyperionSmartTag.dll and HsTbar.xla from the Bin folder. Path : <Drive:>\Hyperion\SmartView\Bin 2. Paste it on the Add Ins fold

  • Async disk IO in TOP 5 timed event

    Hi all, I took a statspack report and i found that in the Top 5 timed event we are getting async disk io Tablespace IO Stats for DB: ac  Instance: ac11  Snaps: 101 -102 ->ordered by IOs (Reads + Writes) desc Tablespace                  Av      Av