Invoking custom object method

Hi to everybody. I'm looking for a solution to my problem and I hope someone could help me.
My classes are the following:
public class sharedFunc {
public int getMyValue()
return 10;
public class midClass {
public sharedFunc A;
public class Main {
private midClass mc;
public void action()
try {
java.lang.reflect.Field field = this.getClass().getDeclaredField("mc");
field.setAccessible(true);
"In this point I need to get value 10 invoking getMyValue"....
field.setAccessible(false);
} catch(Throwable t) {
t.printStackTrace();
public static void main(String[] args) {
Main myApp = new Main();
myApp.action();
I need (from Main) invoke getMyValue from class sharedFunc using reflection.
Tnks a lot.

Tnks very much for you reply... Now with your help I'm at the following point but I'm locked invoking method getMyValue
try {
   Field mcF = this.getClass().getDeclaredField("mc");
   mcF.setAccessible(true);
   Field getValF = mcF.getType().getDeclaredField("sharedFunc");
   // Read the method I need
   Method gmvM = getValF.getType().getDeclaredMethod("getMyValue");
   // Try to invoke
   gmvM.invoke(getValF.get(this));
   mcF.setAccessible(false);
} catch(Throwable t) {
   t.printStackTrace();
}but obviously I get an error:
java.lang.IllegalArgumentException: Can not set sharedFunc field midClass.customFunc to Main...
What's the right way to invoke method??
Tnks a lot again!

Similar Messages

  • Invoking Custom Methods with MiniButtons Not Working

    Hi Experts,
    I followed the steps in the Siebel 7.8 doc exactly to invoke method with
    miniButton, but it gave me error:
    The specialized method 'MyTest' is not supported on Business Component
    'Account' used by Business Object 'Account'.(SBL-DAT-00322)
    The steps I copied from the doc shown below, is the doc wrong in certain
    step or anything else I need to take care? I also checked the Siebel
    SupportWeb about the error code, but didn't seem to solve this simple test
    case.
    Any help is appreciated!
    Michelle
    Invoking Custom Methods with MiniButtons
    Be sure to set up Tools for the appropriate Target Browser Group.
    To invoke a custom method with a MiniButton
    1. Choose an applet (for example, Account List Applet) and create a
    control with the following properties:
    Name = ButtonTest
    Caption = Test
    HTML Type = MiniButton
    Method Invoked = MyTest
    2. Right click the Applet and choose Edit Web Layout.
    The Web layout editor appears.
    3. Change the template mode on the Web Controls toolbar to 3: Edit
    List.
    A window opens with the available controls, including the one you just
    created.
    4. Drag and drop the control the ButtonTest control onto an available
    location. When you release the mouse button, the button appears.
    5. Click Save and then choose File > Close.
    6. To add a server script to the applet that enables the button,
    right-click the applet and choose Edit Server Scripts. Add the following
    script to the WebApplet_PreCanInvokeMethod() function.
    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
    if ( MethodName == "MyTest" )
    CanInvoke = "TRUE";
    return( CancelOperation );
    return (ContinueOperation);
    7. Add the following browser script to the applet you are using (for
    example, the Account List Applet).
    function Applet_PreInvokeMethod (name, inputPropSet)
    switch (name) {
    case "MyTest":
    alert( "Siebel 7 browser script!" );
    return("CancelOperation");
    break;
    return ("ContinueOperation");
    8. Run any application that has access to accounts, and go to the
    Accounts screen.
    The new button should appear.
    9. Click Test.
    The Browser Script should display an alert box indicating "Siebel 7
    Browser Script!"

    Hi
    As said above I have tried with Account List Applet and created a new control with MethodInvoked Property=Test; HTML Type=Button and added to the weblayout
    2.Enable the new button on the applet
    Applet--->Server Script
    function WebApplet_PreCanInvokeMethod (MethodName)
    if(MethodName=="Test")
    CanInvoke="True";
    return(CancelOperation);
    return (ContinueOperation);
    3.Applet--->BrowserScript---->
    function Applet_PreInvokeMethod (name, inputPropSet)
    if(name=="Test")
    alert ("Your Result is success")
         return ("ContinueOperation");
    when clicked on button it was throwing following error:
    Siebel Error Message SBL-DAT-00322: The specialized method is not supported on Business Component ' used by Business Object .
    gone through support web and read possible reasons but I am not able to find out where I was wrong
    I am using siebelV 7.7 ; Applet is using Class:"CSSFrameListBase". It is not a Copied applet.
    Could you please suggest me.
    Thank You,

  • Methods to transfer Customer objects while Upgrading.

    Hi,
    What are the possible methods of transferring Customer objects/programs etc while upgrading from 4.6 to 4.7 or ECC ?
    Any information will be helpful.
    Thanks,
    s<i><b>A</b></i>mik.

    Hi Rekha,
    After the Basis team have done with the Prepare activities , we need to RUN the SPDD transcations which provides the details of SAP Std DDIC objects that have been modified by the CLient It team. You will requuire take a deceiosn to keep the changed format or revert back to the SAP std structure. More often the decison would be to keep the changes format in the new version also. It is mandatory to complete this cativity so that you do not run the risk of any data loss in the new version of SAP.
    After completeing the SPDD activity , we need have choice of taking the SPAU transcation to get the list of the STD SAP programs that have been modified. This activities can be done in phases even after the upgrade o fthe box. generally it is done in the same go so that your testing results are consistent and have more confidence in upgrade.
    Then we need o move with the corrections of the Z/Y objects for sytax . Once we have complted these three ABAP workbench corrections cativities we need to get into a testing activity.
    Hope this helps.
    Anand

  • Invoking custom methods in application modules

    Hi,
    I am absolutely new to oracle ADF.I was recently working with application module.My question is how do I call a custom method(say myCustomMeth(String str) ) residing inside my application module from my Managed bean?I saw one example where the operation(i.e. the method) was directly dragged and dropped onto the jspx page from the data control.Is it the right way of doing it?I also saw one example where operation binding was used to invoke a method inside the application module although I didn't understand the code fully.I am really confused now.Please help.
    Thanks in advance.

    user11930797 wrote:
    My question is how do I call a custom method(say myCustomMeth(String str) ) residing inside my application module from my Managed bean?You write the custom Application Module method and you expose it to the AM's client interface. By doing so, the custom operation becomes available in the AM Data Control and can be bound to your jspx page.
    I saw one example where the operation(i.e. the method) was directly dragged and dropped onto the jspx page from the data control.Is it the right way of doing it?I also saw one example where operation binding was used to invoke a method inside the application module although I didn't understand the code fully.Both of the methods that you are mentioning above are used:
    1. You can drag the custom method from the data control in JDeveloper and drop it in your page as a command button or link to create a method binding declaratively this way. The method binding is executed via some command button or link and your custom AM method is called, or
    2. You can create the method binding yourself in the bindings tab of you jspx page, add the command button in your page and define an action listener for it in your backing bean. In your backing bean action listener you can write the necessary code to execute the method binding, which will call your custom AM method.
    Hope it is clear.
    Nick

  • Invoking Business Service method which takes Hierarchy / Integration Object

    Hi,
    I want to invoke Business Service methods using JDB API invokeMethod(). There are some methods which take Hierachy/Integration object as argument. The question here is how do I creat and pass these arguments?
    Following two are the methods which take these arguments.
    1)[Hierarchy]
    Business Service:
    SHM Calculate Tax
    Method:
    SumCalculateTax
    Args:
    CalculateTax - Hierarchy - Input
    ForWhich - String- Input
    GetSubTaxCodes - Number- Output
    GetTaxCodes - Number- Output
    2)[Integration Object]
    Business Service:
    External Contact
    Method : Update
    Args :
    SiebelMessage - Integration Object - Input / Output
    Can you direct me to some sample code please?
    Thanks,
    ram

    Thank you both for the response. Regarding Rennay’s posting I have an additional question. When I create a new web service I don't have the "Document Literal" option nor a "Concrete Configuration" tab. I've created the web service using the "Web Application" project type and then adding a web service using the "Web Service..." wizard. This wizard doesn't have the configuration properties you mention, but if I add a WSDL-file to a BPEL-project the wizard has the properties you mention.
    Is it possible to create a web service, programmed as an ordinary Java-class, from an existing WSDL-file? In that case it may solve the problem with the “Document Literal” property. Currently I don’t know any other way to create such a web-service other than the through the web service wizard in a web application project. Of course, it’s possible to craft it from scratch but that’s to much work to be practical.
    Regards, Ola

  • Clone a method for my custom object.

    Hi!
    We have a method:
    comp.saveFrameToPng(compTime, fileObj);
    I have my custom object block.
    Is it possible to clone "saveFrameToPng" method for my custom object?
    I've tried:
    Function.prototype.clone = function() {
        var that = this;
        var temp = function temporary() { return that.apply(this, arguments); };
        for(var key in this) {
            if (this.hasOwnProperty(key)) {
                temp[key] = this[key];
        return temp;
    And then in my custom object:
    function block (comp)
    this.saveFrame = comp.saveFrameToPng.clone();
    But thin won't work properly
    Help me please if this possible.
    Thank you in advance!

    Hi
    static public long powerTwo(long number)
         long ret = 2;
         if(number == 0)
              return 1;//2 to the power of 0 is 1
         else
                    //use a for loop to loop as many times as specified by number,
                    //times 2 to ret every time it loops
         return ret;//return the answer
    }Hope this helps

  • How do you invoke custom java classes???

    Could someone post a detailed method of invoking custom java classes that works including what files go where, settings and the way it is invoked etc.
    I have tried various ways from this forum and in the documentation without success. I am using IDM 8. I found these instructions regarding how you would do it if you were writing custom resource adaptors in the deployment tools guide:
    To install a resource adapter you’ve customized:
    1. Load the NewResourceAdapter.class file in the Identity Manager installation
    directory under
    idm/WEB-INF/classes/com/waveset/adapter/sample
    (You might have to create this directory.)
    2. Copy the .gif file to idm/applet/images.
    This .gif file is the image that displays next to the resource name on the List
    Resources page, and it should contain an image for your resource that is
    18x18 pixels and 72 DPI in size.
    3. Add the class to the resource.adapter property in
    config/waveset.properties.
    4. Stop and restart the application server. (For information about working with
    application servers, see Identity Manager Installation.)
    I tried the instructions here but placed my custom class in a folder entitled custom instead of /adapter/sample. Not sure about instruction 3 or whether it is relevent. Anyway nothings working.
    Edited by: masj78 on Nov 25, 2008 3:50 AM
    Edited by: masj78 on Nov 25, 2008 4:03 AM

    Hi,
    The way to add custom class is the same as you followed , put them in the WEB-INF/classes.
    To use the custom adapter ,
    Go To Resources - > Configure Types -> Add Custom Resource .
    Type in the fully qualified class name of the custom adapter you added.and Save.
    Now the new adapter you added should showup in the list of available adapters when you try to
    configure a new adapter.
    (Make sure that the prototype XML of your custom adapter is correct so that it displays the correct name / type for the adapter in the adapter list.
    Thanks,
    Balu

  • Strange about invoking web service method declared “string  method(void)”;

    Dear forum readers
    I’m experimenting with OpenESB and web services. I’ve create a simple web service using NetBeans 6.1. The method consists of a single method, getTime, that is declared:
    String getTime()
    My current experiment is to invoke this method from a BPEL-process using the “Invoke” process object. The strange thing is that it seems like I have to provide a “dummy” inbound variable from the BPEL-designer even though the method doesn’t take any parameters. I include a snippet from the BPEL process below which includes the section where I set the dummy GetTimeIn-variable and then invokes the WS method getTime().
    <assign name="Assign2">
    <copy>
    <from>'DummyValue'</from>
    <to variable="GetTimeIn" part="parameters"/>
    </copy>
    </assign>
    <invoke name="Invoke1" partnerLink="PartnerLink1" operation="getTime" xmlns:tns="http://ws/" portType="tns:MyWebService" outputVariable="GetTimeOut" inputVariable="GetTimeIn"/>
    If I don’t initiate the dummy variable or remove it altogether, I can’t successfully call the method. If I include the dummy in-parameter the call works just fine and I get back the current time as a string.
    I must admit that I’m still a rookie to web services, especially when calling them from a BPEL-process, so it may be a very trivial reason for this behaviour. Anyway, any help on this matter would be greatly appreciated.
    Regards, Ola

    Thank you both for the response. Regarding Rennay’s posting I have an additional question. When I create a new web service I don't have the "Document Literal" option nor a "Concrete Configuration" tab. I've created the web service using the "Web Application" project type and then adding a web service using the "Web Service..." wizard. This wizard doesn't have the configuration properties you mention, but if I add a WSDL-file to a BPEL-project the wizard has the properties you mention.
    Is it possible to create a web service, programmed as an ordinary Java-class, from an existing WSDL-file? In that case it may solve the problem with the “Document Literal” property. Currently I don’t know any other way to create such a web-service other than the through the web service wizard in a web application project. Of course, it’s possible to craft it from scratch but that’s to much work to be practical.
    Regards, Ola

  • Creation of Data Control for custom java method  which will return records

    Hi Guys,
    I have a requirement of creating a a custom java method in App module which will return a record set taking an id as input.In case of single return type it works fine but in case of returning record set it is not working.In my case i have to combine two tables and return it as a single entity as a view in Data Control.
    Warm Regards,
    Srinivas.

    Why don't you just create a custom view object? There's even an example or 2 in the docs:
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/intro_tour.htm#CHDGDIEC (check out "View object on refcursor" example)
    Edit: you are aware that you can create a View Object based on more than one table?
    John

  • 10.1.3.4 - How to access custom java methods in worklist ?

    We want to invoke a custom java method inside of worklist, when the file attachments are added to the worklist. We are planning to modify the auto-generated jsp page to do the same. We have created the custom jar files, but am not sure where to deploy this jar file ? We are not able to compile the jsp /jar. Does anybody have any idea where the custom jar file goes ?

    The bpel\samples\hw\worklistapp\readme will explain you about how to do this.

  • Obiee 11.1.1.6  Actions- Invoke a Java Method screen is empty

    Hi All,
    I have created and deployed an EJB for obiee11g by using the example provided in the below link
    http://www.rittmanmead.com/2010/09/oracle-bi-ee-11g-action-framework-java-ejbs-and-pdf-watermarks/
    I have mapped oracle.bi.actions also
    But I am not able to see the java method in the obiee11g Actions- Invoke a Java Method screen .The screen is empty
    I have configured the ActionFrameworkConfig.xml as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <obi-action-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="afconfig.xsd">
    <aliases/>
    <registries>
    <registry>
    <id>reg05</id>
    <name>WaterMark EJBS</name>
    <content-type>java</content-type>
    <provider-class>oracle.bi.action.registry.java.EJBRegistry</provider-class>
    <description>WaterMark BIEE</description>
    <location>
    <path/>
    </location>
    <custom-config>
    <ejb-targets>
    <appserver>
    <context-factory>weblogic.jndi.WLInitialContextFactory</context-factory>
    <jndi-url>t3://localhost:9704</jndi-url>
    <server-name>localhost</server-name>
    <account>WLSJNDI</account>
    <ejb-exclude>mgmt</ejb-exclude>
    <ejb-exclude>PopulationServiceBean</ejb-exclude>
    </appserver>
    <ejb-app>
    <server>localhost</server>
    <app-context>watermark</app-context>
    </ejb-app>
    </ejb-targets>
    </custom-config>
    </registry>
    </registries>
    <content-types>
    <content-type>
    <typename>webservices</typename>
    <displayname>Web Services and BPEL Processes</displayname>
    <actionType>WebServiceActionType</actionType>
    </content-type>
    <content-type>
    <typename>misc</typename>
    <displayname>Mixed Services</displayname>
    <actionType>URLActionType</actionType>
    </content-type>
    <content-type>
    <typename>java</typename>
    <displayname>Java Services</displayname>
    <actionType>JavaActionType</actionType>
    </content-type>
    </content-types>
    <accounts>
    <account>
    <name>WLSJNDI</name>
    <description>Account used to access WLS JNDI.</description>
    <adminonly>false</adminonly>
    <credentialkey>JNDIUser</credentialkey>
    <credentialmap>oracle.bi.actions</credentialmap>
    </account>
    </accounts>
    </obi-action-config>
    Please help me to resolve this issue
    Regards
    Deepz

    1. check your t3 port no, in my case it's 7001.
    so i changed "<jndi-url>t3://localhost:9704</jndi-url>" to "<jndi-url>t3://localhost:7001</jndi-url>"
    2. if you run obiee 11.1.1.6.0 above, you don't need below.
    <credentialmap>oracle.bi.actions</credentialmap>
    so please drop this line.
    3. restart your server and check there's no error log when loading ActionFrameworkConfig.xml.
    Good Luck !!!

  • JoinFieldValue function and custom object 4,5

    Hi,
    Can JoinFieldValue function be used for custom objects 4 and 5? If I want to update the Account field on custom object 5 based on the Account field in custom object 4, can this be done using JoinFieldValue ? How?
    Regards,
    Ani.

    Hi Ani,
    Currently JoinFieldValue is not supported in Custom Objects 04-15. You will have to use web services for Updating Account field on Custom Object 5 or else you can try the URL method to update the Account field .
    Thanks & Regards
    Sablok

  • Custom toJSON() method is not called for each property

    I'm getting familiar with JSON in ActionScript 3 (FP 11), and experimenting with custom toJSON methods. The Developer's Guide section on Native JSON Support clearly states:
    JSON.stringify() calls toJSON(), if it exists, for each public property that it encounters during its traversal of an object. A property consists of a key-value pair. When stringify() calls toJSON(), it passes in the key, k, of the property that it is currently examining. A typical toJSON() implementation evaluates each property name and returns the desired encoding of its value.
    However, both the subsequent examples on the very same page and my own tests indicate that, on the contrary, toJSON() is only called once for the whole object, and no argument is passed for k. Take the following trivial class:
    public class JSONTest {
        public var firstProperty:int = 1;
        public var secondProperty:String = "Hello world";
        public function toJSON(k:String):* {
            trace("Calling toJSON on key", k);
            return this[k].toString();
    According to the documentation this should cause the following to print:
    Calling toJSON on key firstProperty
    Calling toJSON on key secondProperty
    And the output should basically be the same as without a custom toJSON method:
    { "firstProperty" : 1, "secondProperty" : "Hello world" }
    Instead, this just throws an error because nothing at all is passed as k.
    So, is the documentation wrong and the engine is not supposed to call toJSON for every property, or is the engine incorrectly only calling it once?

    I just figured out what the documentation means. k refers to the name of a property to which the entire instance being stringified is assigned, not to the names of the properties of the instance being stringified. An example is much clearer:
    var wrapper:Object = { prop1 : 1, prop2 : new JSONTest() };
    trace("Stringify result =", JSON.stringify(wrapper));
    Prints:
    k:String = prop2
    Stringify result = {"prop2":{"firstProperty":1,"secondProperty":"Hello world"},"prop1":1}
    So k is the name of the property on wrapper, not on the JSONTest instance. When stringify is called directly on an instance of JSONTest, k is empty because the JSONTest instance is not assigned as a property of another object, it is just all by itself. Either way the value returned by toJSON must be a string or object representing the stringified form of the entire instance.

  • Return value of Custom object in HashMap

    I have created a custom object (TableValue) that should represent the key value in aHashMap. When reading data from a file, the custom object should be either a String or a Double. I want the custom object to return the proper type. That is, I am trying to avoid the use of an Object as a key value in the HashMap. However, I want TableValue to return the proper value. Some example code is listed below. My question is this, how do I get TableValue to return the proper type?
    Thanks
    import java.util.HashMap;
    public class Table {
    HashMap<TableValue,Frequency>table=new HashMap<TableValue,Frequency>();
         public void count(TableValue aElement){
              Frequency fq=table.get(aElement);
              if(fq==null){
                   fq=new Frequency();
                   table.put(aElement, fq);
              }else{
                   fq.add();
         public double getCount(TableValue aElement){
              Frequency fq=table.get(aElement);
              if(fq==null){
                   return 0.0;
              }else{
                   return fq.getFrequency();
         public static void main(String[] args) {
              Table tab=new Table();
              tab.count(new TableValue("s"));
              tab.count(new TableValue(5.0));
    public class TableValue {
         private double dValue;
         private String sValue;
         private boolean isDouble=false;
         public TableValue(Object o){
              try{
                   if(o.getClass().getName().equals("java.lang.String")){
                        sValue=(String)o;
                   }else if(o.getClass().getName().equals("java.lang.Double")){
                        dValue=(Double)o;
              }catch(ClassCastException ex){
            //next two methods not correct, can not overload like this
         public double getValue(){
              //want to return a double
              return dValue;
         public String getValue(){
              //want to returna string
              return sValue;
    public class Frequency {
         private double total, cummulativeFrequency;
         public Frequency(){
              total = 1.0;
              cummulativeFrequency = 0.0;
         public void add(){
              total++;
              cummulativeFrequency++;
         public void addCummulativeFrequency(double aLowerCount){
              cummulativeFrequency += aLowerCount;
         public double getFrequency(){
              return total;
         public double getCummulativeFrequency(){
              return cummulativeFrequency;
    }

    OK, thanks to everyone for your help. Here is what I have done. I added equals(), hashCode(), and compareTo().
    My compareTo() method seems a bit sloppy. Basically, I want Strings to appear before Doubles in a sort. Is there a better way to do this?
    import java.util.Arrays;
    import java.util.HashMap;
    import java.util.Iterator;
    public class Table {
         HashMap<TableValue,Frequency>table=new HashMap<TableValue,Frequency>();
         public void count(TableValue aElement){
              Frequency fq=table.get(aElement);
              if(fq==null){
                   fq=new Frequency();
                   table.put(aElement, fq);
              }else{
                   fq.add();
         public double getCount(TableValue aElement){
              Frequency fq=table.get(aElement);
              if(fq==null){
                   return 0.0;
              }else{
                   return fq.getFrequency();
         public Object[] getKeyArray(boolean sorted){
              TableValue[] keys=new TableValue[table.size()];
              int i=0;
              for(Iterator iter=table.keySet().iterator();iter.hasNext(); ){
                   keys[i++]=(TableValue)iter.next();
              if(sorted){
                   Arrays.sort(keys);
              return keys;
         public static void main(String[] args) {
              Table tab=new Table();
              tab.count(new TableValue("a"));
              tab.count(new TableValue("a"));
              tab.count(new TableValue("d"));
              tab.count(new TableValue(5.3));
              tab.count(new TableValue(6.123));
              Object[] keys = tab.getKeyArray(true);
              System.out.println("count " + tab.getCount((TableValue)keys[0]));
    public class TableValue implements Comparable{
         private Double dValue;
         private String sValue;
         public TableValue(String sValue){
              this.sValue=sValue;
         public TableValue(double dValue){
              this.dValue=dValue;
         public Double getDoubleValue(){
              return dValue;
         public String getStringValue(){
              return sValue;
         public boolean isDouble(){
              if(dValue!=null) return false;
              return true;
         public boolean equals(Object o) {
              return o.equals(sValue) || o.equals(dValue);
         public int hashCode(){
              int hash=0;
              hash += (null == dValue ? 0 : dValue.hashCode());
              hash += (null == sValue ? 0 : sValue.hashCode());
              return hash;
           public int compareTo(Object anotherTableValue) throws ClassCastException{
                if(!(anotherTableValue instanceof TableValue))
                     throw new ClassCastException("TableValue object expected.");
                //compareTo for two Doubles
                if(((TableValue)anotherTableValue).getDoubleValue()!=null &&
                          this.getDoubleValue()!=null){
                     System.out.println("yes" +((TableValue)anotherTableValue).getDoubleValue()!=null &&
                               this.getDoubleValue()!=null);
                     Double anotherDouble=((TableValue)anotherTableValue).getDoubleValue();
                     return this.dValue.compareTo(anotherDouble);
                //compareTo for two Strings
                if(((TableValue)anotherTableValue).getStringValue()!=null &&
                          this.getStringValue()!=null){
                     String anotherString=((TableValue)anotherTableValue).getStringValue();
                     return this.sValue.compareTo(anotherString);
                //sort Strings before Doubles
                if(((TableValue)anotherTableValue).getStringValue()!=null &&
                          this.getStringValue()==null){
                     return 1;
                //sort Strings before Doubles
                return -1;
           public String toString(){
                if(dValue==null){
                     return sValue;
                return dValue.toString();
    }

  • How to Invoke two java methods parallaly

    Hi,
    I need to invoke two Java methods parallaly ,for example if i am having two methods in a class
    public class Test {
        public Test() {
        public static void main(String[] args)
        Test test = new Test();
        String returnString1 = test.test1();
        String returnString2 = test.test2();
        public String test1(){
        String newString1 = "";
        return newString1;
        public String test2(){
        String newString2 = "";
        return newString2;
    }if i run the above class two methods will be invoked one by one(Sequentially).is there any possibility to invoke these two methods parallaly (ie) both methods need to be invoked at the same time.

    import java.lang.reflect.Method;
    class Paralell implements Runnable{
          private Object srcObject;
          private String methodName;
          private Class parameterTypes[];
          private Object parameterArgs[];
          private Object returnObject;
          public Paralell(Object srcObject, String methodName, Class parameterTypes[], Object parameterArgs[]){
              this.srcObject = srcObject;
              this.methodName = methodName;
              this.parameterTypes = parameterTypes;
              this.parameterArgs = parameterArgs;
          public Object getReturnObject(){
             return this.returnObject;
          public void run(){
               Method method = null;
                try{
                    method =  srcObject.getClass().getDeclaredMethod(this.methodName,this.parameterTypes);
                    this.returnObject =method.invoke(this.srcObject,this.parameterArgs);  
                }catch(Exception exp){
                   exp.printStackTrace();
                }finally{
                    method = null;
    }

Maybe you are looking for

  • Bridge Raw not working, cannot see Raw image in Bridge

    The RAW setting in Bridge is not working. When I open Bridge I can see only icons, no images. The RAW tool icon is grey, not active. I am going on a trip Tomorrow and I need Bridge to be working. It was working earlier.

  • Script to change page to section in entire document

    Hi, using CS2 (WIN) I have a problem with setting sections which might sound trivial. From time to time I have to set-up a questionnaire containing forms. These forms will be filled in later by the user. In order to give some advice on how to fill in

  • From Lightroom to DPS ?

    Hi Guys not sure I can do that but let's ask I have built some books with Lightroom, I am a photographer, so it's just a portfolio of my photos so I would like to know if I might build my App via LR any ideas ? Many thanks, Thierry

  • F.27 - Fax or Print Customer Statements

    Hello Gurus- I have searched high and low in the forum and could not find a solution.  How do you email Customer Statements?  I know how to email Invoices by maintaining email address via Customer Master Data but I thought the same would be true for

  • Trace changes in change request.....?

    Hi all, I have to enhance a datasource which is already in production. i created one customize request means as per my knowledge is it change request. so how would i know that all changes against datasource been saved into this request for exporting