About CLASS-METHODS?

Hi Guys,
In ABAP objects i have seen while declaring methods, they are prefixing CLASS-METHODS?
Actually what does that mean?
Regards,
Ammu

Declares static events in a class or interface in ABAP Objects.
You can only use this statement in the declaration part of a class declaration (see CLASS ) or interface definition (see INTERFACE). The CLASS- prefix to the EVENTS statement means that the event evt is declared as a static event. Otherwise, the CLASS-EVENTS statement has the same syntax as the EVENTS statement for instance events.
Static events belong to the static components of a class. Unlike instance events, that can only be triggered in instance methods, static events can be triggered both in instance methods and in static methods.
Within a class, the appearance of static events is the same as that of instance events, and they can be addressed in the same way. You can also define handler methods for static events using the SET HANDLER statement if their visibility allows it. In this case, there is no FOR addition, since the required information is already available through the definition of the event handler method, and you do not have to specify a triggering instance.
Note
If the class has a static constructor (a method called CLASS_CONSTRUCTOR) that has not yet been executed in the program, it is executed on a static event in the class before the first registration of an event handler method.
Example
CLASS C1 DEFINITION.
  PUBLIC SECTION.
    METHODS CONSTRUCTOR.
    CLASS-METHODS CREATE_COUNT_RESET.
    CLASS-EVENTS  COUNT_RESET.
  PRIVATE SECTION.
    CLASS-DATA CREATE_COUNT TYPE I.
ENDCLASS.
CLASS C2 DEFINITION.
  PUBLIC SECTION.
    METHODS COUNT_HANDLER FOR EVENT COUNT_RESET OF C1.
ENDCLASS.
DATA: O1 TYPE REF TO C1,
      O2 LIKE O1,
      O3 LIKE O1,
      HANDL TYPE REF TO C2.
CREATE OBJECT: O1,
               O2,
               O3,
               HANDL.
SET HANDLER HANDL->COUNT_HANDLER.
CLEAR: O1,
       O2,
       O3.
CALL METHOD C1=>CREATE_COUNT_RESET.
CLASS C1 IMPLEMENTATION.
  METHOD CONSTRUCTOR.
    CREATE_COUNT = CREATE_COUNT + 1.
  ENDMETHOD.
  METHOD CREATE_COUNT_RESET.
    CLEAR CREATE_COUNT.
    RAISE EVENT COUNT_RESET.
  ENDMETHOD.
ENDCLASS.
CLASS C2 IMPLEMENTATION.
  METHOD COUNT_HANDLER.
    WRITE 'Object counter reset'.
  ENDMETHOD.
ENDCLASS.
This example builds on the first example in the CLASS-METHODS documentation. It is possible to execute the static method CREATE_COUNT_RESET, even though there are no more instances of class C1. The COUNT_HANDLER method of object HANDL of class C2 is registered as handler for the static event COUNT_RESET, and is triggered.

Similar Messages

  • Academic Question about Classes Method and Constructor

    Given the similarity between the Constructor class and the Method class, why don't they have a common super class for the methods they have in common that are unique to them?

    sledged wrote:
    jschell wrote:
    sledged wrote:
    I've found that the most common reason for invoking a constructor or method through reflection is because you don't know what you need until runtime, commonly because what you want can vary based on context, or is otherwise being specified external to the bit of code that uses reflection. Not true. The fact that I don't need it until runtime never means I don't know what I need.Never? Then your experiences with the reflection API have been different than mine. Either that or I wasn't very clear. Let's take Apache Commons BeanUtils;
    It doesn't matter how you access a class. You can't use it unless
    1. You have a goal in mind
    2. That object in some way fulfills that goal.
    3. You know how that object fulfills that goal.
    And as I already pointed out you can't use a JFrame for a JDBC driver. Simple as that. Nor can I create a new class that implements, for example, ProC (Oracle method to embed access into C code) using my own idiom despite that it provide database access. It MUST match what jdbc expects.
    Sometimes it's not even clear before runtime whether a constructor's needed or a method.
    I disagree. That isn't true in any OO language.Perhaps not out the box, but it can be true when using certain tools built from the OO language. Let me continue using the Spring framework as an example. It does not know whether to use a method or a constructor to instantiate any bean defined in the XML configuration metadata until that XML file is read and it determines whether or not a given bean definition has the "factory-method" attribute. The XML file in not read until runtime, therefore with any given bean defined therein, Spring does not know until runtime whether to use a constructor or method.Not apt at all.
    As I already said those are two different idioms. Spring supports them because they are used to solve different problems not because they wish constructors didn't exist.
    >
    The basis of OO is the "object". You can't have a method without the object in the conceptual OO model. (And in Smalltalk that is always true.)
    True, but one may not always care how the "object" is provided. When the method [Properties.load(InputStream)|http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load%28java.io.InputStream%29] is called, it isn't going to care whether the InputStream argument was instantiated by one of the FileInputStream constructors, or if it came from a [URL.openStream()|http://java.sun.com/javase/6/docs/api/java/net/URL.html#openStream%28%29] method call. It'll work with either regardless of their respective origins.
    That of course has nothing to do with anything. Unless you are suggesting that construction in any form should not exist.
    A factory is not a constructor.I'm not saying it is. I'm just pointing out a number of the similarities between the two.
    So? There are many similarities between RMI and JDBC but that doesn't mean that they should be the same.
    With your argument you can claim that construction doesn't exist because any method, regardless of intent, that uses 'new' would eliminate the need for construction. And that isn't what happens in OO languages.I wouldn't claim that construction doesn't exist in any OO language. But I do know that in ECMAScript construction exists on the basis of whether or not a method is called with the 'new' operator. So in ECMAScript a single method can also be a constructor.
    And in C++ I can entirely circumvent the object construction process. Actually I can do that in JNI as well.
    I would still be a bad idea.
    >
    They are not interchangable.Normally, no, but with a high enough level of abstraction, they can become interchangeable. Again, the Spring framework is a great example. It doesn't care if a method or a constructor is used, and it won't know which one has been chosen until runtime. I don't even think Spring checks the return type of a method, so you could use a void return type method. (Although I don't know what that would buy you because the bean would always be set to null, but still...)
    No.
    Based on that argument every possible programming problem could be solved by simply stating that one must implement the "doit()" method. One just need to generalize it enough.
    Different APIs exist because there are in fact differences not because there are similarities.
    Over generalization WILL lead to code that is hard to maintain. Actually generalization itself, even when done correctly, can lead to code that is actually more complex.
    Because construction is substantially different than calling a method. In all OO languages.Yes, construction is different, but the actual call to a constructor and a method is only syntactically different with the presence of the 'new' operator. With reflection the difference is between calling Method.invoke() and Constructor.newInstance(), and, as I mentioned earlier, there's enough similarity between the two methods that they could be called by a single method specified by a common super class.Which does not alter the fact that the process of achieving the result is fundamentally different.

  • Where can I find the detail document about certain method of a class?????

    Moved to correct forum by moderator
    Hi everyone,
    where can I find the detail document about certain method of a class?????
    e.g.  the class CL_GUI_ALV_GRID , when I was going through the class and looking
    at the methods, sometimes the method description is just like the method name,
    and I cannot know what the method does. 
      so, I am wondering  where I can find the detail information about the class???
    Edited by: Matt on Dec 4, 2008 11:55 AM

    Hi,
    Most of the times the SAP itself provides the documentaion of the CLASS. when you click on the METHOD name the METHOD DOCUMENTATION button you can see on the application tool bar.
    more over the names of the methods suggest what it is going to do.
    SET_ATTRIBUTE( sets the attribute)
    GET_ATTRIBUTE( gets the attribute value that is provided to the method)
    GET_CHILDNODE
    BIND_TABLE
    etc
    like this
    regards
    Ramchander Rao.K

  • A question about a method with generic bounded type parameter

    Hello everybody,
    Sorry, if I ask a question which seems basic, but
    I'm new to generic types. My problem is about a method
    with a bounded type parameter. Consider the following
    situation:
    abstract class A{     }
    class B extends A{     }
    abstract class C
         public abstract <T extends A>  T  someMethod();
    public class Test extends C
         public <T extends A>  T  someMethod()
              return new B();
    }What I want to do inside the method someMethod in the class Test, is to
    return an instance of the class B.
    Normally, I'm supposed to be able to do that, because an instance of
    B is also an instance of A (because B extends A).
    However I cannot compile this program, and here is the error message:
    Test.java:16: incompatible types
    found   : B
    required: T
                    return new B();
                           ^
    1 errorany idea?
    many thanks,

    Hello again,
    First of all, thank you very much for all the answers. After I posted the comment, I worked on the program
    and I understood that in fact, as spoon_ says the only returned value can be null.
    I'm agree that I asked you a very strange (and a bit stupid) question. Actually, during recent months,
    I have been working with cryptography API Core in Java. I understood that there are classes and
    interfaces for defining keys and key factories specification, such as KeySpec (interface) and
    KeyFactorySpi (abstract class). I wanted to have some experience with these classes in order to
    understand them better. So I created a class implementing the interface KeySpec, following by a
    corresponding Key subclass (with some XOR algorithm that I defined myself) and everything was
    compiled (JDK 1.6) and worked perfectly. Except that, when I wanted to implement a factory spi
    for my classes, I saw for the first time this strange method header:
    protected abstract <T extends KeySpec> T engineGetKeySpec
    (Key key, Class<T> keySpec) throws InvalidKeySpecExceptionThat's why yesterday, I gave you a similar example with the classes A, B, ...
    in order to not to open a complicated security discussion but just to explain the ambiguous
    part for me, that is, the use of T generic parameter.
    The abstract class KeyFactorySpi was defined by Sun Microsystem, in order to give to security
    providers, the possibility to implement cryptography services and algorithms according to a given
    RFC (or whatever technical document). The methods in this class are invoked inside the
    KeyFactory class (If you have installed the JDK sources provided by Sun, You can
    verify this, by looking the source code of the KeyFactory class.) So here the T parameter is a
    key specification, that is, a class that implements the interface KeySpec and this class is often
    defined by the provider and not Sun.
    stefan.schulz wrote:
    >
    If you define the method to return some bound T that extends A, you cannot
    return a B, because T would be declared externally at invocation time.
    The definition of T as is does not make sense at all.>
    He is absolutely right about that, but the problem is, as I said, here we are
    talking about the implementation and not the invocation. The implementation is done
    by the provider whereas the invocation is done by Sun in the class KeyFactory.
    So there are completely separated.
    Therefore I wonder, how a provider can finally impelment this method??
    Besides, dannyyates wrote
    >
    Find whoever wrote the signature and shoot them. Then rewrite their code.
    Actually, before you shoot them, ask them what they were trying to achieve that
    is different from my first suggestion!
    >
    As I said, I didn't choose this method header and I'm completely agree
    with your suggestion, the following method header will do the job very well
    protected abstract KeySpec engineGetKeySpec (Key key, KeySpec key_spec)
    throws InvalidKeySpecException and personally I don't see any interest in using a generic bounded parameter T
    in this method header definition.
    Once agin, thanks a lot for the answers.

  • Calling the super class method from the subclass

    Hi all,
    I have a question about inheritence and redefinition of methods. Is it possible to call the superclass implementation of a method which is redefined in the subclass in another method of the subclass?There are possbilities like creation of an explicit super class instance or delegating the super class method implementation to another method which is also protected etc. What i mean is, is there a direct way of calling it?We have ,me,   as the reference for the instance we have(which is the subclass instance in this case), is there also a way of pointing the superclass implementation(with super we can reference in the subclass redefinition, my question is if we have such a parameter in other methods of the subclass too)
    Thanks in advance
    Sukru

    Hi,
    The super reference can only be used in redefined methods to call superclass implementation . So probably what you can do is use upcasting and access the required superclass implementation. I can think of only this way...;-)
    Ex data lr_super type ref to cl_superclass
    lr_super = lr_subclass.
    lr_super->method().
    ~Piyush Patil

  • A function module or class/method to look up repository objects?

    Hi,
    Does anyone know of a class/method or a function module that returns back objects of a namespace in the integration repository.
    For example, I would like to be able to retrieve all the message interfaces of a particular namespace.
    Thanks in advance,
    Duke

    Hi Duke,
    I am not sure about the function module. But you can look up all the objects with their IDs using transaction sxi_cache.
    Regards,
    Ramesh P

  • Class method for XI data into R/3????

    Hi Experts,
    I have a very big problem..please help me!!!!
    We need to create a program that will call data from XI interface and populate the internal table in R/3?
    Can any1 of u give me the steps to go forward with it?
    I read some documents and found that we need to use Class METHOD.. but I am new to OOPS and dont know anything in it.
    Its about server proxies I guess!!!
    I need to finish this in 1 day...
    Please help.. answers will be rewarded with points...

    Hi, Thanks for the reply. I cannot use IDOC.
    I have data in XI interface in form of XML data and i want to populate internal table in R/3 with this XML data(From XI).
    If anybody can give me the steps to do the same, it will be very helpful.
    my mail id is [email protected]
    please try to send me the steps with an example...

  • Questions about classes

    Hi,
    I finally upgraded from Flash 5 to CS3 - big difference :-)
    Reading the first half of an ActionScript 3 book left me
    quite confused about classes - what they are, how you handle
    multiple classes, how you use one class from within another etc.
    Are there any simple-speak tutorials out there that explain
    more about how to use classes?
    Specifically:
    I am trying to use classes to run multiple animations at the
    same time, i.e. using randomized movement for multiple objects on
    my stage.
    First issue is: If I do what I learnt in the book and simply
    create one .as file and have that be the document class, how can I
    prevent it from being run before all the elements on the stage have
    been loaded through a slow network connection?
    Second issue: I'd rather have "dormant" classes sitting
    around and call them once my stage is ready, but I have no idea how
    to handle multiple classes. I played with it for a while and then
    gave up and put my code into a frame, but that caused further
    issues. Again, any tutorials out there or any other advice you can
    give me? I am trying to start some class code at a certain time and
    use it to attach a Frame Event listener to a Sprite that I create
    inside the class.
    It looks easy in the book, but when I try to do my own stuff,
    it just won't do it...
    The book assumes (so far) that you want to run your code
    immediately once your movie starts, but I don't want that...
    Thanks!

    Yes, I realized later that _root etc. is actually as1 code
    from my days of Flash 5 :-)
    All I need is to know how to access a movieclip on the stage
    that was placed using the IDE from within a class, and how to
    access a class and call its methods from within another, and I can
    teach myself the rest...
    So, if I place something with the IDE, doesn't it show up in
    the display list? I should be able to control those elements, too,
    shouldn't I?
    Or do I have to use Actions rather than classes for those
    elements?
    I probably read 5 different articles/ebooks on the topic of
    classes and OOP in AS3 already, and none gave me the answer I
    needed.
    But I will have a look at the site you mentioned.
    Thanks!

  • Classes & Methods

    Hi Experts,
                          Please see the following requirement in Classes & Methods, which I have to develop.I need this logic , Please send me the logic based up on old logic which i had given below.  
    The following needs to be created once, after which, the call to the method should be inserted in all related outputs.
    I have to create this Method:  IS_SEQUENCE_NOT_TO_PRINT. 
    This must be a value method in class ZCL_CONFIGURABLE_ITEM, passing document number VBDKR-VBELN that returns a parameter value: X = True, Blank = false.
    This is the example method which they had given me to see it and do the same to that method with suitable changes,
    [See e.g. method IS_GENOSYS_ITEM below from class ZCL_CONFIGURABLE_ITEM.
    For this e.g. Method logic is defined.
    **(METHOD is_genosys_item.
      STATICS: l_gen_cats TYPE z_pstyv_tt.
      DATA:    l_gen_cat_line TYPE zpstyv_line.
      IF l_gen_cats[] IS INITIAL.
        CALL METHOD zcl_configurable_item=>get_gen_valid_item_cats
          IMPORTING
            itemcats_range_all_out   = l_gen_cats
          EXCEPTIONS
            no_item_categories_found = 1
            OTHERS                   = 2.
        IF sy-subrc <> 0.
          is_genosys_item = space.
          RETURN.
        ENDIF.
      ENDIF.
      IF item_cat_in IN l_gen_cats
        AND NOT l_gen_cats[] IS INITIAL.
        is_genosys_item = c_checked.
      ELSE.
        is_genosys_item = space.
      ENDIF.
    ENDMETHOD.)**]
    For our Method ‘IS_SEQUENCE_NOT_TO_PRINT’
    ,we have to  Include the following logic :
    GET BILLTO_PARTNER customer number for the document (reading VBPA where VBELN = document number VBDKR-VBELN and partner PARVW = ‘RE’ / ‘BP’)
    Read table KNA1 to get field KNA1-KATR6 where KUNNR equals Bill to partner, and fields VBDKR-VKORG, VBDKR-VTWEG, VBDKR-SPART,
    Store first character of field KNA1-KATR6 in a work field e.g. W_ KATR6.
    Add the entry below to the ZLITERAL table in all clients
    Read the records from ZLITERAL table (reading key1 = C_ZLIT_GENOSYS_KEY, and key2 = C_KATR6_1) where C_KATR6_1 = attribute on class, with value = KATR6_1 .  You must add this attribute on the class.  Populate the internal table L_ZLITERAL_TAB type ZLITERAL_TAB_TYPE.
    See e.g. in method GET_GEN_VALID_PRICE_CONDS of class ZCL_CONFIGURABLE_ITEM
    [**(Method GET_GEN_VALID_PRICE_CONDS.
      data: l_zliteral_tab type ZLITERAL_TAB_TYPE,
            l_zliteral type zliteral,
            l_kscha type zkscha_line.
      select *
        from zliteral
        into table l_zliteral_tab
        where zkey1 = zliteral_key1_in
          and zkey2 = zliteral_key2_in.
      if sy-subrc = 0.
        loop at l_zliteral_tab into l_zliteral.
          clear l_kscha.
          l_kscha-sign = l_zliteral-zvalue1.
          l_kscha-option = l_zliteral-zvalue2.
          l_kscha-low = l_zliteral-zvalue3.
          append l_kscha to condtype_range_out.
        endloop.
      else.
        raise no_pricing_conds_found.
      endif.
    endmethod.)**]
    Declare a range R_KATR6_1 in the program and load range from internal table L_ZLITERAL_TAB.
    Check if stored field W_ KATR6 (i.e. first character of KNA1-KATR6) is in the range not to print R_KATR6_1.
    If the value in the stored field is in the range not to print R_KATR6_1, set the returning parameter to ‘X’ using attribute c_checked.  If not, it means that the sequence should be printed.  So the value method should return the value ‘ ‘ – initial. 
    In the print program, call the value method once while processing the header section and store the value in a work field.  This field can be used later when processing each item.  It is not necessary to call the method for each item.  Once is fine, as the data is at header level.
    How to call the value method:
    W_NO_SEQUENCE_PRINT = zcl_configurable_item=> IS_SEQUENCE_NOT_TO_PRINT (VBDKR).
    Add “ IF STATEMENT “ as seen below:
    IF W_NO_SEQUENCE_PRINT IS INITIAL.
      IF wgen-bulk_item <> 'X'.
        IF wgen-prfid = c_oligo.
          PERFORM write_oligo_sequence.
        ELSEIF wgen-prfid CS c_peptide.  "
          PERFORM write_peptide_sequence.
        ENDIF.
      ENDIF.
    ENDIF.

    Hi,
    try the online tutorial, which you can access via the Documentation/Tutorials link on the left side. Work on the examples given there and read the explainations carefully - first, try to understand, what is said there, then look at the examples and think about that, what every statement does and why it is there. Next step - try to reproduce the given example by yourself - do not look in the code of this example and do not copy parts of it - try to do it really by yourself - this way, you will learn, what the methods, you use, are for.
    greetings Marsian

  • About calling method with arguments

    Hi,
    I have a problem about calling method using reflection. my method is like follows:
    public myMethod(Integer var1, MyObject mobj) {
    I've tried to call the method using the following code,
    Class[] parameterTypes = new Class[] {Integer.class, MyObject.class};
    Object[] arguments = new Object[] {new Integer(2), mobj};
    Method met=cl.getMethod("myMethod", parameterTypes);
    But the in the last line NoSuchMethodException is thrown.
    How can I send the reference of MyObject to myMethod()?
    Thanx
    rony

    Should work ok:
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    public class Test {
         static class MyObject {}
         public static void main(String[] args) throws Exception {
              Class c = Test.class;
              Class[] parameterTypes = new Class[] {Integer.class, MyObject.class};                              
              try {
                   Object[] arguments = new Object[] {new Integer(2), new MyObject()};
                   Method met = c.getMethod("myMethod", parameterTypes);
                   met.invoke(new Test(), arguments);
              } catch (NoSuchMethodException e) {
                   System.out.println(e);
              } catch (IllegalAccessException e) {
                     System.out.println(e);
              } catch (InvocationTargetException e) {
                   System.out.println(e);
         public void myMethod(Integer var1, MyObject mobj) {
              System.out.println("myMethod");
    }

  • Which of the following are true about abstract methods in EJB 2.0

    Hi guys I'm beginner to EJB and i got some unanswered questions.
    Can any one of you please.. give answers?
    Thanks if you do...
    Which of the following are true about abstract methods in EJB 2.0
    CMP?
    Choose all correct answers:
    1. Abstract accessor methods should not be exposed in the EJB
    component's interface
    2.Abstract accessor/mutator methods are used to access and modify
    persistent state and relationship information for entity objects
    3.Abstract Accessor/Mutator methods do not throw exceptions
    4.The EJB developer must implement the Accessor/Mutator methods
    5.Abstract accessor methods may or may not be exposed in the EJB
    component's interface
    2.Which ONE of the following is true?
    Choose the best answer:
    1.Local interfaces cannot have a relationship with other Entity
    components
    2.Local interfaces cannot be used for Stateless Session EJB
    3.Local interfaces can be a part of Object's persistent state
    4.Local interfaces have the same functionality as that of a
    stateless Session EJB
    3.Which of the following describe the <cmr-field> in a EJB 2.0
    descriptor?
    Choose all correct answers:
    1.A Local interface/Entity can be a value of a <cmr-field>
    2.There is no <cmr-field> in EJB 2.0 descriptor
    3.It is used to represent one meaningful association between any
    pair of Entity EJBs, based on the business logic of the Application
    4.It provides a particular mapping from an object model to a
    relational database schema
    5.It allows the Local Entity interfaces to participate in
    relationships
    4.Which of the following are the advantages of using Local interfaces
    instead of dependent value classes?
    Choose all correct answers:
    1.Local Entity Interfaces can participate in Relationships
    2.The life cycle of Local Entity Interfaces is managed by EJB
    container, intelligently
    3.Local Entity Interfaces can be used in EJB QL Queries
    4.Local Entity Interfaces can be a part of the <cmp-field> but not
    <cmr-field>
    5.Which of the following are true about Local interfaces
    1.A local interface must be located in the same JVM to which the EJB
    component is deployed
    2.Local calls involve pass-by-reference.
    3.The objects that are passed as parameters in local interface
    method calls must be serializable.
    4.In general, the references that are passed across the local
    interface cannot be used outside of the immediate call chain and must
    never be stored as part of the state of another enterprise bean.
    6.Which of the following specifies the correct way for a client
    to access a Message driven Bean?
    Choose the best answer:
    1. via a Remote interface
    2. via Home interface
    3. Message driven bean can be accessed directly by the client
    4. both 1 & 2
    5. none of the above
    ------------------------------------------------------------------------7.Which of the following statements are true about message-driven
    bean Clients?
    ------------------------------------------------------------------------Choose all correct answers:
    They can create Queue and QueueConnectionFactory objects
    They can create Topic and TopicConnectionFactory objects
    They can lookup the JNDI server and obtain the references for
    Queue and Topic and their connection Factories
    Only 1 and 2 above

    Hi guys I'm beginner to EJB and i got some unanswered
    questions.
    Can any one of you please.. give answers?
    Thanks if you do...
    Which of the following are true about abstract methods
    in EJB 2.0
    CMP?
    Choose all correct answers:
    1. Abstract accessor methods should not be exposed
    d in the EJB
    component's interfacefalse
    2.Abstract accessor/mutator methods are used to
    access and modify
    persistent state and relationship information for
    entity objectstrue
    >
    3.Abstract Accessor/Mutator methods do not throw
    exceptionstrue
    >
    4.The EJB developer must implement the
    Accessor/Mutator methodsfalse
    5.Abstract accessor methods may or may not be exposed
    in the EJB
    component's interfacetrue
    2.Which ONE of the following is true?
    Choose the best answer:
    1.Local interfaces cannot have a relationship with
    other Entity
    componentsfalse
    2.Local interfaces cannot be used for Stateless
    Session EJBfalse
    3.Local interfaces can be a part of Object's
    persistent statefalse
    4.Local interfaces have the same functionality as
    that of a
    stateless Session EJBtrue
    3.Which of the following describe the <cmr-field> in a
    EJB 2.0
    descriptor?
    Choose all correct answers:
    1.A Local interface/Entity can be a value of a
    <cmr-field>true
    2.There is no <cmr-field> in EJB 2.0 descriptorfalse
    3.It is used to represent one meaningful association
    between any
    pair of Entity EJBs, based on the business logic of
    the Applicationtrue
    4.It provides a particular mapping from an object
    model to a
    relational database schematrue
    5.It allows the Local Entity interfaces to
    participate in
    relationshipstrue
    4.Which of the following are the advantages of using
    Local interfaces
    instead of dependent value classes?
    Choose all correct answers:
    1.Local Entity Interfaces can participate in
    Relationshipsis
    2.The life cycle of Local Entity Interfaces is
    managed by EJB
    container, intelligentlyis
    3.Local Entity Interfaces can be used in EJB QL
    Queriesnot
    4.Local Entity Interfaces can be a part of the
    <cmp-field> but not
    <cmr-field>not
    >
    >
    5.Which of the following are true about Local
    interfaces
    1.A local interface must be located in the same JVM
    M to which the EJB
    component is deployedtrue
    2.Local calls involve pass-by-reference.true
    3.The objects that are passed as parameters in local
    l interface
    method calls must be serializable.false
    4.In general, the references that are passed across
    s the local
    interface cannot be used outside of the immediate
    e call chain and must
    never be stored as part of the state of another
    r enterprise bean.true
    >
    6.Which of the following specifies the correct way for
    a client
    to access a Message driven Bean?
    Choose the best answer:
    1. via a Remote interfacefalse
    2. via Home interfacefalse
    3. Message driven bean can be accessed directly by
    the clientfalse
    4. both 1 & 2false
    5. none of the abovetrue.
    >
    ----------------7.Which of the following statements
    are true about message-driven
    bean Clients?
    ----------------Choose all correct answers:
    They can create Queue and QueueConnectionFactory
    objectsthe container can, dunno bout clients
    >
    They can create Topic and TopicConnectionFactory
    objectsthe container can, dunno bout clients
    >
    They can lookup the JNDI server and obtain the
    references for
    Queue and Topic and their connection Factories
    true
    Only 1 and 2 abovefalse
    somebody correct me if i'm wrong

  • Setting Control-Flow- Case on java class/method

    hello All :D
    i have little problem about control flow case, in my case i've 2 page where before load to the page i'wanna make condition (if-else)
    when the user choose the field, the java class get the value for make true condition. In this case, i wanna implement ControlFlowCase in java class/method, so anyone help..?
    thx
    agungdmt

    Have you considered using router activity - http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/taskflows_activities.htm#CJHFFGAF ?

  • Error in class method

    Hi Friends,
    i am facing one problem while preparing code in proxy class method. i need to use same code so many places in my class method for that purpose  i was trying to use perform statements but system is giving syntax error 'Forms can not be defined in a class pool For this reason, there are no perform statements for internal FORM'S'.
    With out perform statements how to handle the repetative logic in same program. Any help will be highly appreciated.
    Thanks a lot in advance.

    If you are talking about global classes,
    then go to SE24 and create your class.
    In the class go to Methods tab, give a name to your method, Define it as a static method, if you want the values to be persisted and not specific to the instances that are created based on your class.
    Give the visibility as private, becuase you want these private methods only to be called in your class only.
    Then click on parameters and define your exporting and importing parameters.
    Double click on the method name and have your repetitive code there.
    YOu can call this method in other methods of the class using
    call method <method name>statement.
    Regards,
    Ravi

  • Class methods, (sqlite)

    Hey,
    I'm working on a sqlite database application and I need to declare class variables (or something similar) to use within a class method.
    what i'm trying to do is compile and run some sql queries throughout my app. Now all the instance methods I call for class objects are fine because they are being called by a specific object of that class.
    I need to call a method (which is actually a sql query) at any time even tho there are no objects presently in the database to pass the method to. Therefore, i've created a class method to do this so I can call this method anytime I want on the class itself.
    Problem is, I don't know where/how to declare class variables to use in this query (such as the handler for the database itself, statement handler, etc...
    Also I want these variables to be accessible by other classes so that way I can pass the data from the result set into an array or whatever.
    Anyone know how I can do this?

    yeah, when I was looking into this yesterday I came across a "Cocoa Design Guidelines" guide and they were talking a little about singletons....
    I've never used them.....do you know of any examples where one is used so I can see how it's used in an actual app (maybe one of the sample apps from Dev portal??)
    Thanks
    Frank

  • Access global data of report in global class methods?

    Hi all,
    I have defined one global class in SE24 and i am using methods of this class in report program.
    Can i access global data of my report program in class methods directly without declaring it as IMPORT
    parameter?
    Thanks,
    Apita

    Hi,
    Well, now you did confuse me: first you asked about using global data of a report program in global class (created in SE24), and the answer is: no, you can't directly access the global data of another program in a method of global class (yes, you should pass them via importing parameters), and you shouldn't even consider using indirect means of doing so via special form of ASSIGN statement reserved for internal use by SAP. The ASSIGN will not work if someone reuses the global class elsewhere in the system without loading your report. Don't ever program such atrocious dependencies in global class...
    And now you ask about the use "in method implementation in report program"..? Just to be sure - you can't program the implementation of a global class method in a report program.
    You can program a local class inheriting from a global class and redefine/re-implement methods of such global super-class in a report program. Global data of report program, including the selection screen, would be directly accessible to such local class. It would still not be a good idea to use this access:
    Conversely, within an encapsulated unit, that is, within a class, you should avoid accessing more global data directly. Within methods, you should generally modify attributes of the class only. Write access to global data outside the class is not recommended. Accessing data in this way should only be done using specially marked methods, if at all. The use of methods of a class should not evoke any side effects outside the class itself.
    cheers
    Jānis
    Message was edited by: Jānis B

Maybe you are looking for

  • Trashed files on a Toshiba stick , found by turning on show hidden files.

    I rescued a bunch of files from a memory stick by the above method. I dropped these into a new folder on the laptop. When I went into the folder , all were available. But After turning off "show all hidden files," I lost some , but not all , files. T

  • N97 has ruined my life...

    ...well nearly. Had a problem where suddenly Mail for Exchange wouldn't sync contacts. The phone suggested contacting the administrator but other Exchange devices were working fine (blackberry, webmail, entourage). Eventually I backed up the phone (N

  • Dry Loop

    I have dry loop for DSL.  Now I want to add vonage, but I can only get phone service on one phone.  How do I get it through the rest of my phone lines.  My internet works in every room. Why not the phone? Solved! Go to Solution.

  • Replacement of Spl Characters- REPORT

    Hi All, I want to replace some special characters like & with 'and' # with num. etc in my report. I tried using REPLACE ALL OCCURANCE OF but this gives performance issue and the report takes a long time to be executed. Moreover i cannot specify offse

  • I need table name

    Hi Experts, I am doing regression testing for which I have to test Customer Master using Cs-feed. How to do that? I checked previous doc in which there is excel file which contains cistomer data like age,***, name etc alnog with that queue id and mes