Interface method inlining

hi
I'm not sure, if this is the right forum to post to. Please move this thread to the correct one, if it is not.
Here is my question:
I want to write an "OpenGL wrapper-wrapper", that allows an abstract access to JOGL, LWJGL, etc. (for now only the two). This is only possible through an interface. In an OpenGL application there are many, many small calls to many OpenGL commands. So, if these methods are not inlined, the whole wrapper-wrapper doesn't make much sense.
I could not find any clear documentation about it. Are such methods inlined by the JIT compiler? I'm using Java 1.5 and 1.6. I know, this question cannot be answered generally. But all these methods will look similar to these ones:
Interface:
public void glDoSomething(int foo, FloatBuffer bar);
public void glDoSomethingElse(int foo);
public void glEnable(int state);
public void glDisable(int state);(e.g.) JOGL implementaion
public void glDoSomething(int foo, FloatBuffer bar)
     // invoke the JOGL method in this implementation
    gl.glDoSomething( foo, bar );
public void glDoSomethingElse(int foo)
     // invoke the JOGL method in this implementation
    gl.glDoSomethingElse( foo );
public void glEnable(int state)
     // invoke the JOGL method in this implementation
    if (!gl_states[ state ] )
        gl.glEnable( gl_const_map[ state ] );
        gl_states[ state ] = true;
public void glDisable(int state)
    if (gl_states[ state ] )
         // invoke the JOGL method in this implementation
        gl.glDisable( gl_const_map[ state ] );
        gl_states[ state ] = false;
}Would this be inlined by Java 1.5 and/or Java 1.6? Is there any good documentation about this problematic? Is there any way to ask the VM about it?
Any help is very appreciated.
Marvin

Well, the JIT compiler only inlines actual code. So you can't tell from an
interface definition whether it will decide to inline an implementation of a
method or not.Well, that's exactly, what my initial question was aiming at. I do know, that the implementing method is simple enough to be inlined. I just wanted to know, if the JIT compiler is even able to inline such code, that just implementes an interface. Is there any clear documentation about it?
No, you're right. Why would the fact that interesting or annoying questions get replies lead you to think otherwise? The volunteers here answer whatever questions they feel like answering. If nobody finds yours interesting enough or konws enough about it to answer it, it may go untouched. Or maybe the handful of people who would be interested/qualified just didn't see it before others' questions came in and pushed it down the list. If you don't get an answer after several hours or a day, a polite bump just to push it back to the forefront is fine. Just don't get too impatient or people will start getting irritated and be more inclined to flame your for your bad manners than to help you.
I'm very sorry, if I said anthing offending. Sometimes I do, even if I didn't want to. I was just wondering, if this forum actually makes sense in this way, if too few people are here, who answer questions. Believe me, when I say, that I do know, that it is (or can be) a hard job to keep track of all requests in a forum or even in a complete board. I will always be greatful for anybody, who takes up this work.
But I am convinced, that my question is an interesting one not only for me. So I was wondering, how such a forum could ever fullfill its role, if quesions like this get flooded down to page 10 in such a short time. Many questions will stay unanswered, if they would need to be recognized in minutes to not get flooded on pages, where noone will ever look again for them.
And further belive me, that this is not to be offending in any way. I just wanted to explain, why I was so shocked, that I wrote something like the above. Sorry, if this was misunderstandable.
I could be wrong but I believe this already exists.I would be highly interested, if you could point me to where it already exists.
Thanks.
Marvin

Similar Messages

  • Method Inlining in HotSpot VM

    Hello Folks,
    in the recent past I read a lot of posts and papers about method inlining in the HotSpot VM (especially method inlinings based on invocations via invokevirtual). From what I read the JVM is able to inline even such methods when there is only one class which implements the referred interface (since there is only one possibility for the dynamic type of the interface reference). These information might be true. But I want to see it with my own eyes. Is there any JVM option which makes it easy to profile when a method is inlined at runtime? I found that the option -XX:+PrintInlining would be the one I have to use. But when I try to enable this option while starting the JVM in debug mode the following error occurs: "Unrecognized VM option ''+PrintInlining".
    Does anybody know what is going wrong? The version of my JVM is 1.6 (which should support this option).
    I'm also interested in any information (preferred scientific papers) about method inlining in the HotSpot JVM.
    Thank you very much...

    Sorry...instead of invokevirtual I meant INVOKEINTERFACE.
    Is there noone who has some hints for me?

  • Calling an interface METHOD of another abap web dynpro application

    Hi Experts,
    Can u plz tell how we can Call an interface METHOD of another abap web dynpro application in main WD Component.
    Thanks
    Mahesh

    Hi ,,
       Example ALV interface method calling   GET_MODEL interface method
       View attribute   declaration   :    M_WD_ALV  type      IWCI_SALV_WD_TABLE
         DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
          wd_this->M_WD_ALV =   wd_this->wd_cpifc_alv( ).   "ALV is the usage name
         DATA lv_value TYPE ref to cl_salv_wd_config_table.
          lv_value = wd_this->M_WD_ALV->get_model(  ).   " interface method calling in ALV component usage.....
    Regards,
    Devi

  • Access specifiers for interface methods

    When we implement the interface ,we have to specify the implementing method access specifier to be "PUBLIC" ,but not "PROTECTED" or "PRIVATE".
    Compiler is giving an error -- attempting to assign weaker access privileges ,when we specify protected.
    what is the internal reason for this?Why we shouldnt make the access weaker in the implementing class.
    Can any one help me on this.Your help is highly appreciated.

    When we implement the interface ,we have to specify
    the implementing method access specifier to be
    "PUBLIC" ,but not "PROTECTED" or "PRIVATE".
    Compiler is giving an error -- attempting to assign
    weaker access privileges ,when we specify protected.
    what is the internal reason for this?There is absolutely no point in having a private interface method. The interface represents a visible abstraction and private methods are never visible so it is a contradiction in terms.
    An interface is intended to represent an abstraction that a user (software) uses. Protected via child/parent represents a usage that is restricted to a child from a parent. The child can already see the parent so there is no point in having an abstraction for the child. And it would probably be unwise to limit a child by such an abstraction.
    Protected via the package and interfaces is more contentious as to why it is not allowed. There are those that argue that this should be allowed so that a package can use interfaces but restrict them to the package. To me this seems like a minor point given that most interfaces will probably represent an abstraction to other packages and not within a single package. This applies specifically to default access as well.

  • Interface Method

    Hi experts,
    I have the following scenario:
    Component A opens, in a modal window, the component B.
    When I do something in B, it's closed and I return to A.
    There, I need read data from B (which is closed at the moment), to do something in A.
    Anybody knows how can I do it?
    I tried with external context mapping, but It doesn't work...
    Could it be done with interface methods?
    Thanks in advance!
    Lucas

    Hi Padmam,
    Thank you for your reply too, but I'm having problems with your solution.
    I have created an interface Node in Component A, and I have created the mapping in the component usages of the component B.
    When I run component A, it gives me an error. I supose that it is rise by this Interface Node.
    This error is solved when I check out the property "Input Element (Ext)" of Interface Node, but without this property, I can't do the External Mapping...
    Could you correct me if I'm wrong?
    Thanks in advance!
    Lucas

  • Question when i am in web dynpro interface method trying to find code

    Hello guys,
    I am in an event handler and i see this logic wd_this->mo_dodm_srchbidder_c->add_selected_bidder().  When i double click on the add selected bidder it takes me to the method inside interface /sapsrm/IF_CLL_DODM_BIDDER.   So when i double click on the method it takes me nowhere.
    My question is what do i have to do or where do i go to see the code for add_selected_bidder?   thank you.

    I think, you have visited to the definition of the interface method and not the implementation of the method.
    You have instantiated the wd_this->mo_dodm_srchbidder_c some where, may be in the wd domodifyview. Find that out where the implementation happens.
    I believe when you double click the method in  editor ask for to go to definition or implementation.

  • Overriding Interface methods via JNI

    Hello,
    How we can override Interface methods via JNI?
    For example:
    At HelloWorldSwing example:
    http://download.oracle.com/javase/tutorial/uiswing/examples/start/HelloWorldSwingProject/src/start/HelloWorldSwing.java
    I've written anonymous Interface as:
    import javax.swing.*;       
    public class HelloWorldSwing1 {
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("HelloWorldSwing");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Add the ubiquitous "Hello World" label.
            JLabel label = new JLabel("Hello World");
            frame.getContentPane().add(label);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        static Runnable runnableObject = new Runnable() {
             public void run() {
                  createAndShowGUI();              
       public static void main(String[] args) {
             //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            SwingUtilities.invokeLater(runnableObject);
    }via JNI functions(http://download.oracle.com/javase/1.4.2/docs/guide/jni/spec/functions.html) we cannot override Runnable Interface's run method? Can we?
    Only:
    RunnableClass's value isn't null with given example at below. FindClass finds the Runnable Interface.
    jclass RunnableClass;
    RunnableClass = (*env)->FindClass(env,"java/lang/Runnable");
      if( RunnableClass == NULL ) {
        printf("can't find class Runnable\n");
        exit (-1);
      }But How can we override Runnable class's run method?
    Thanks in Advance

    The only way you can override a method in Java is by defining a class that does so, either statically or as an anonymous inner class. You can't do either of those things in JNI. Ergo you cannot do what you are asking about.

  • Accessing an app.module's client interface methods in other app module

    Hi all,
    We are developing an application with number of projects (one for each module). We have got a common project with an application module, entity and view objects which are common for the entire application. For reusability, this common project is shared in session scope since most of them are of static nature.
    In the shared application module's implementation class, a common method has been included that will be used for data filtering by constructing/appending where clauses in a particular application scoped view object. This method has been exposed as client interface method so that other projects can make use of it. The common project is compiled as an ADF Library jar for accessing it in other projects.
    For accessing the exposed client interface method, from the view controller layer, we can include its reference in the page definition file and can execute the method from a managed bean by finding the operation binding from the page definition. But, in case if we wish to access the method in another model project, we could not do so.
    Now, my questions are:
    1. Is it the correct location(Shared App Mod. Impl) for including the logic to filter the data?
    2. Is it possible to access the app. module impl method in another project's impl classes (Let it be entityImpl or viewObjectImpl or viewRowImpl or AppModImpl) ?
    3. If it is possible, how it has to be done?
    Thanks and regards,

    Strange, the same question here {thread:id=2187487}
    Timo
    Edited by: Timo Hahn on 08.03.2011 12:02
    @john You beat me agian

  • Redefine Interface Method

    Hi, I am using a BI Interface "IF_RSCNV_EXIT" and I am adding code to the "Exit" Method. 
    Do I need to redefine this method?  The reason I ask is because the redefine icon is greyed out even though I am in edit mode.
    Thanks!

    Hello Kenneth
    Interface methods are always empty. You can implement them only once within a hierarchy of classes using this interface. Thus, you cannot redefine it.
    Regards
      Uwe

  • Interface method in enhancement mode

    Hello Experts,
    I need to enhance a standard web dynpro component. I have created a new method in the component controller using enhancement implementation. This method has to be called from another component. Therefore I need to make this as an interface method. But in enhancement mode I do not see an option to make this method as an interface mathod. Kindly let me know if this is poosible.
    Thanks,
    Pooja

    Hi Pooja,
    Please check this threads.. Hope you understand.
    Add an interface Method/Event via enhancement??
    How to make Interface node in an Enhancement Implementation
    Cheers,
    Kris.

  • Class/Interface/Methods

    Hi All,
    I'm trying to understand the concept behind abap class/interface/methods.
    1. Is it mandatory to have an interface in every class?
    2. Once a class is created is it right to define methods as static and public and use them without reference to the interface?
    Any help appreciated.
    Meghna

    hi meghna,
    interfaces in ABAP Objects play the same role as classes. Just like classes, interfaces are object types that reside in the namespace of all types. While a class describes all aspects of a class, an interface only describes a partial aspect
    The syntax for declaring a local interface is:
    INTERFACE intf.
       DATA ...
       CLASS-DATA ...
       METHODS ...
       CLASS-METHODS ...
    ENDINTERFACE.
    Basically, the declaration of an interface corresponds to the declaration part of a class, where instead of CLASSu2014ENDCLASS, you simply use INTERFACEu2014ENDINTERFACE. Interfaces can contain exactly the same components as classes. Unlike classes, however, interfaces don't need to be divided into different visibility sections because interface components are always integrated in the public visibility section of classes.
    i dont want to confuse you .
    please go to the below link to know more about... interface and classes.
    [http://help.sap.com/saphelp_nw04/helpdata/en/ec/d9ab291b0b11d295400000e8353423/frameset.htm]

  • Add an interface Method/Event via enhancement??

    Hi expert.
    I want to pass additional data between two standard webdynpro components. As for as I know, I can use infterface method/event in custom webdynpro component and click check box 'Interface' of method/event.
    However I can add new method/event in standard webdynpro via enhancement,  the check box 'Interface' is dispear.
    So is it possibe to add an interface method/event via enhancement? or pass additional data between standard webdynpro component?

    Hi,
    First you need to understood the standard webdynpro component which you are looking for.
    If the standard component is providing interface methods/events then you can call from your custom  webdynpro component  re-using the standard component in your custom component.
    If you provide mroe information about which standard component and which event/method you are looking for, so that I will provide more info.
    Best of luck..
    Regards,
    Naresh

  • Why are interface methods public?

    I want to define a package interface that will be implemented only by package classes which will be used only by other package classes. Why do the methods have to be public?

    In java you don't have multiple inheritance. To
    circumvent that it is said to extend the most
    important class and implement the others with
    interfaces. No. Java does not support multiple inheritance. Interfaces do not exist to supply that functionality. Interfaces can be used to simulate some of the patterns that multiple inheritence represents.
    (You can have skeleton implementations to
    help you implement those interfaces in other
    classes).
    But the interface methods are public. So all the
    classes you 'extend' via this trick have all methods
    public.
    This is a bad thing. All of you who have used RMI (or
    J2EE) know that you can serialize objects between two
    networked machines. ValueObjects pattern from J2EE
    toolbox is a good example of this. Now, if you happen
    to have several quite similar objects, you obviously
    would like them to inherit those common traits from
    some base class. If you would also like them to have
    some other common functionality (for example server
    side 'maintenance' methods, state monitoring, checking
    and clearing, you would have to make those methods
    public 'cos you only have interface implementation
    left - after spending that single credit to actual
    inheritance.No. Convienence ("common functionality") should not be used in most cases when designing hierarchies. Inheritence should only be used to represent 'is a' relationships.

  • Interface method  not implemented by class :(

    I'm getting an error for interface method
    Interface method handleLogout in namespace  views.interfaces:IWiseMediator not implemented by class  views.mediators:RatingViewMediator.    RatingViewMediator.as 
    package views.interfaces
        import flash.events.Event;
        public interface IWiseMediator
            function handleLogout(event:Event):void;
    but I done this in RatingViewMediator
    private function handleLogout(event:Event):void
                viewObject.clearFields();

    interfaces are used to enforce a public 'interface' to the class. as a private method can only be accessed by the class itself, it doesn't make sense to include private methods in an interface.

  • Create interface method in standard component.

    Hi Experts,i want to enhance standard component.in that i created one attribute and i used in my component.For that attribute the value is passing from some other component.i try to create interface method in standard component.but it is not possible.so please help me out this issue.
    Regards
    prasad

    Hi,
    No, You cannot create Interface Methods/Nodes in Standard Component by Enhancing. I would suggest to create a Singleton class and create your method in that class and can access across components.
    Regards,
    Kiran

Maybe you are looking for

  • Error in initializing web logic server

    Hi, I am new to Jdeveloper and weblogic server. I am trying to create a simple jsp page disppalying nothing but Hello world. When i run my page i get the following error *** Using port 7101 *** "C:\Documents and Settings\murk.gopi\Application Data\JD

  • Offline Mail actions "undone"

    I get the following message in a dialogue: Some actions taken while the account XYZ was offline could not be completed online. ... Mail has undone actions on some messages ... Apple Mail To Do <blah blah> (I'd love to attach a screen shot but that do

  • How can I tell if I need a firmware upgrade?--G5 iSight iMac

    Machine Name: iMac G5 Machine Model: PowerMac12,1 CPU Type: PowerPC G5 (3.1) Number Of CPUs: 1 CPU Speed: 2.1 GHz L2 Cache (per CPU): 512 KB Memory: 1.5 GB Bus Speed: 700 MHz Boot ROM Version: 5.2.6f1 I am going to upgrade from X.4.11 to Leopard and

  • How to execute windows application in Jinternal frame

    I want to execute windows application in a JInternal Frame ?

  • CM-ImportDriver and Get-ChildItem

    I am trying to use the CM-ImportDriver Cmdlet and running into a problem.  After I import the module, I change my site to ABC1:.  From there, I cannot use Get-ChildItem for a UNC path and the CM-ImportDriver throws an error saying it needs a valid dr