Accessing Runtime Object Instances

Can anyone point me in the right direction to write a function that can be invoked at runtime (without resorting to running in debug or profiling) to dump the objects in memory? Seems like the information should be available, since the JVM has to be tracking it. Thanks!

Can anyone point me in the right direction to write a
function that can be invoked at runtime (without
resorting to running in debug or profiling) to dump
the objects in memory? Seems like the information
should be available, since the JVM has to be tracking
it. Thanks!This is not possible. It is not part of the standard runtime support.
If you want profiling and debug information, you use the profiling and debugging support that is part of many JVMs. Many of them support the JDPA and JVMPI interfaces.

Similar Messages

  • MS Access Runtime Activex Object

    Hello All,
    I have one pc where I installed Access 2010 Full version and one pc with a Access Runtime.
    On the pc with the full version i can create a ActiveX "Access.Application" Class and run all
    properties and methods.
    That's not possible with the Runtime version. The Reference to the ActiveX Access Runetime is always Null.
    I found this side http://support.microsoft.com/kb/210132/en-us to solve the problem, but I didn't know
    how to create such a source code in labview.
    In the false case of my VI you see the runtime method, but I do not know how to continue
    at this Point (relating to the link):
    Run-Time Version of Microsoft Access
    4. Type the following procedure
    Does somebody know how to create the "GetObject" Method in labview?
    Thanks!
    Attachments:
    c_printReportAccess (DA504).vi ‏24 KB
    shellexecute (DA504).vi ‏15 KB

    Hi,
    Did you have a look into this whitepaper? I think you can find some usefull help there.
    Converting Visual Basic ActiveX Examples to Equivalent LabVIEW
    http://www.ni.com/white-paper/2734/en
    Regards,
    Thomas

  • Why can private variables be accessed by other instances?

    From an OO design perspective, I'm sure this makes sense, but perhaps somebody could articulate it for me so that I can understand the rationale.
    I can see that one way of looking at encapsulation is that the object itself should be encapsulated and if you have 2 Person objects, why should one Person be allowed access to another Person's private data?
    Why is this not how Java decides to implement access modifiers (i.e. not a per-instance basis)?...I have no idea how other languages do it because I'm new to all this, but perhaps you can explain for me.

    I don't know why it was designed that way, but
    consider this:public class Example {
    private int value = 42;
    public void setAnotherValue(Example ex, int
    nt newValue) {
    ex.value = newValue;
    Thanks for your example. Looking at it, it makes me realize that this per-class access is specially meant for access to other instances, because otherwise the method would just look like this, correct?
    public void setAnotherValue(int newValue) {
       this.value = newValue;
    }How would the runtime check you mentioned look? I couldn't figure out which of the following two you had in mind and are appropriate:
    public void setAnotherValue(Example ex, int newValue) {
       if (ex == this)
         ex.value = newValue;
      else
         throw new RuntimeException();
    }or this...
    Example e1 = new Example();
    Example e2 = new Example();
    if (e2 != e1) throw new RuntimeException();
    e2.setAnotherValue(e1, 57);

  • Add ABAP program: validating package - error accessing shared objects-area

    When adding a new program or browsing the packages in eclipse i get an "error accessing shared objects-area".
    I can edit, save and run existing ABAP reports, however.
    There was a similar problem here, regarding database procedure proxies but the solution doesn't apply to my problem, i guess. The solution was about creating the shared memory area CL_RIS_SHM_AREA. I can't access the memory area and start the constructor, as it doesn't show up on the monitor.
    ADT 2.28
    Eclipse 4.3
    Netweaver 7.31 SP4 -> is this really compatible with ADT 2.28?
    Thanks in advance for helpful hints,
    Julian

    HI Julian,
    if the area doesn't show up in the monitor, please try to start the constructor in transaction SHMM on your own by selecting the icon 'Start Constructor' as shown in the screenshot.
    Choose CL_RIS_SHM_AREA as area, select 'Default Instance' and 'Dialog' as execution mode. Then press 'Create'. Either this works or the system will tell you the issue with the instance creation (e.g. insufficient shared objects memory - see the other solution description).
    Best regards, Sebastian

  • Is there a way to access ABAP OO instances from a batch job report

    Hello,
    I am looking for a way to access ABAP OO instances from a batch job report. My circumstances are the following:
    I have got some ABAP OO coding that identifies other objects (class instances) that have to be processed (they have a DoIt method that does some calculation). As this processing is time consuming and performace relevant I have to parallelize this in batch jobs. This batch jobs however can only be "simple" ABAP reports according to SM36. The problem is now that I dont really know how to tell the batch job report what objects to process. Somehow I have to access theses instances from  that batch job report.
    Does anybody have an idea?
    Greetings
    Matthias

    Hi David,
    thanks a lot for your help. After a lot of searching on the net this seems to be the only way to cope with it. However I am not sure about the locking mechanisms and if its suitable for mass data processing. In the help page you suggested the following is stated which I do not fully understand::
    "The current lock logic does not enable you to set specific locks for the following requirements:
    ·        Many parallel read and write accesses
    ·        Frequent write accesses
    ·        Division into changeable and non-changeable areas
    Although the lock logic makes the first two points technically possible, they are not practical because most accesses would be rejected."
    Does this mean
    a) if I dont want to set "specific locks" for frequent write accessess I am fine
    or
    b) I am discouraged from use shared memory technics for frequent write accessess?
    In the latter case I will have a problem...
    What do you think?
    Greets
    Matthias

  • How can i have a refrence of a java class object instance in my c++ project

    Hi!
    How can i have a refrence of a java class object instance in my c++ project. Is there a way?

    hahaxia wrote:
    The second question is the big one. The first question is half of the problem of "c++ to java" invocation and access. But the other half which is "java to c++ " invocation and access is still not solved. jni only provide the "java to c++ " DLL invocation Wrong,
    Using JNI your java classes can have methods implemented in C/C++.
    Using JNI you can call java classes.
    There is no other possible interaction between C++ and java, so it does it all.

  • Access to object list of type "BusinessSystem" using the InternalEOAService BusinessSystemAccessor failed

    Hi All,
    We are facing an issue in PI configuration when, we are unable to view business systems in the Integration Builder.
    ERROR : Access to object list of type "BusinessSystem" using the InternalEOAService BusinessSystemAccessor failed
    Our Landscape is as follows:
    PI : Based on NW7.4
    Connected to Central SLD on Solman 7.1
    OS : Windows 2008
    DB : MSSQL 2008
    We checked OSS note 1117249 - Incomplete Registration of PI components in SLD
    The problem seems to be with incomplete registration of PI components on the central SLD.
    In the Central SLD which we have configured, under the Process Integration tab we are unable to see entries for Integration Server, Adapter Engine, Directory, Repository and Runtime Workbench (RWB).
    Can you please help me with registering these components on the Central SLD so that these are visible during the PI configuration.
    Also, any idea if this issue is related to the different versions of PI and Central SLD system.
    Regards,
    Nilesh

    Hi Nilesh,
    Please check SAP Note 764176 - Manual correction of XI content in SLD.
    also check the below discussion
    Problem to register Intergration Server in SLD
    regards,
    Harish

  • Create an object instance without calling its constructor?

    Hi,
    Sometimes it's useful to create object instances without calling their constructor. When? For example object deserialization.
    By default when deserializating an object, the instance in the VM is created by calling the default constructor of the first non Serializable super-class (if you don't have such you're in trouble). I think that the db4o object database don't even call any constructor you may have written.
    So such thing exists, but how is this possible? I fugured out that sun's deserialization mechanism first finds the constructor of the first non Serializable super-class and then:
    cons = reflFactory.newConstructorForSerialization(cl, cons); Here I'm stuck.
    Here's the source of the method for finding serializable constructor:
         * Returns subclass-accessible no-arg constructor of first non-serializable
         * superclass, or null if none found.  Access checks are disabled on the
         * returned constructor (if any).
        private static Constructor getSerializableConstructor(Class cl) {
         Class initCl = cl;
         while (Serializable.class.isAssignableFrom(initCl)) {
             if ((initCl = initCl.getSuperclass()) == null) {
              return null;
         try {
             Constructor cons = initCl.getDeclaredConstructor(new Class[0]);
             int mods = cons.getModifiers();
             if ((mods & Modifier.PRIVATE) != 0 ||
              ((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 &&
               !packageEquals(cl, initCl)))
              return null;
             cons = reflFactory.newConstructorForSerialization(cl, cons);
             cons.setAccessible(true);
             return cons;
         } catch (NoSuchMethodException ex) {
             return null;
        }So any info about this ReflectionFactory, and the problem as a whole?
    Thanks.

    So the question is how to create object instance without initializing it (calling the constructor)? And if you have any info about ReflectionFactory it will be useful too.
    When serializing an object you save all its fields and some extra info. When you deserialize it you have to reconstruct it, by copying the fields back, but not to reinitialize.
    import java.lang.reflect.*;
    import java.io.Serializable;
    import java.security.AccessController;
    import sun.reflect.ReflectionFactory;
    public class Test0 implements Serializable {
        public Test0() {
            System.out.println("Test0");
        public static void main(String[] args) throws Exception {
            Constructor<Test0> constr = reflectionFactory.newConstructorForSerialization(Test0.class, Object.class.getConstructor(new Class[0]));
            System.out.println(constr.newInstance(new Object[0]).getClass());
        private static final ReflectionFactory reflectionFactory = (ReflectionFactory)
         AccessController.doPrivileged(
             new ReflectionFactory.GetReflectionFactoryAction());
    }When you execute this piece you get:
    class Test0

  • Access abap object  from external system

    In R/3 have a Business Objects how can I access this object, for example Workflow BO, from java (external system) using XI????
    My goal is create workflow´s in r/3 sending as input the workflow characteristics and then create the workflow in R/3 and sending as output the idworkflow was creatde.
    thanks in advanced.

    Dear Murali,
    Try this
    a)Start transaction SXI_CACHE.
    b)From the context menu XI Runtime Cache select Start Complete Cache Refresh.
    If you still face issue try this .
    Many actions require to access System Landscape Directory content from the Integration Builder. To optimize performance, this content is loaded into a cache so that the System Landscape Directory does not have to be accessed directly each time that System Landscape Directory content is required.
    However, this cache is not automatically updated if changes are made to the content of the System Landscape Directory. For this reason that we delete the System Landscape Directory cache if changes have been made to content in the System Landscape Directory. The cache is then filled each time that the System Landscape Directory is accessed. If we log on to the Integration Builder after we have made a change in the SLD, we do not need to delete the SLD cache.
    To clear the SLD cache, from the Integration Builder main menu, choose Environment ® Delete Cache for SLD Data.
    Once we have deleted the cache for SLD data, accessing objects in the SLD may take longer than usual initially.
    Regards
    Agasthuri Doss

  • Thru OEM get list of queries and their schemas that accessed my objects

    Hi,
    I have a list of objects on my schema and i need to track the list of sql queries by different users that accessed by object during this time period.
    i haven't enabled any auditing yet.
    is there any way i can get that list of queries and their schemas that accessed those particular objects during a particular time period through OEM.
    Can someone guide me please.
    Thanks in advance.
    Philip.

    create a name property in your class and assign a name property to your instances (either in the contructor) and/or using getters/setters.  (you'll need a getter anyway.)

  • Do we have any native methods to get object instances which are alive ?

    Do we have any native methods to get object instances which are alive ?
    Help appreciated.

    If you are looking for accessing objects that are eligible for GC but are not GC,than it should be very difficult.As Java does not give you memory access to its variables.

  • Please tell me the way to access the object...........?

    when we are decleared a class variable,there should be an object in the memory.this object is the object of the java.obj.Class class.............
    my query is ..
    how to acess that object ?
    e.g.
    public class Basic
    public class Acsess{
    Basic b;//now please tell how access the object of class Basic.Class?......
    thanks and regurds

    I believe that the following example will help. You should also read this tutorial page:
    [Understanding Instance and Class Members|http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html]
    class A
        static String fie = "this is fie";
        String foo = "this is foo";
    public class B
        public static void main(String[] args)
            System.out.println(A.fie);
            A instance = new A();
            System.out.println(instance.fie); // Not recommended; does not
                                              // make it clear that fie is
                                              // a class (static) variable
            System.out.println(instance.foo);
    }

  • Refering to object instances from a jsp

    How can i call object instances within class instances in my application -- from a jsp?
    In other words, i want to reference to an pre-existing application instance of a class.
    I do not want "use:bean" -- which will use a class (not the specific instance i am looking for in the application).
    I also do not want a binding to a variable only ( #{class.variable} ).
    Thank You!
    eric

    That's a good reminder of how to positively access class2, stevejluke. Thanks.
    However, i have found by trying to access a simple String in Class1 that the class1 instantiated by the jsf page (this comes up first in the application and has components which require Class1) is not the same instantiation that being accessed by the jsp page (which is navigated to by a button from the jsf page).
    I put:
    <jsp:useBean id="myBean" class="com.mycompany.expense.EntryHandler" scope="session"/>
    at the top of both the jsf and the jsp page.
    faces-config.xml has:
    <managed-bean>
    <description>
    Glue bean for entry related events and the current entry data
    </description>
    <managed-bean-name>entryHandler</managed-bean-name>
    <managed-bean-class>
    com.mycompany.expense.EntryHandler
    </managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property> ((about 4)) <managed-property>
    <managed-bean>
    I tried setting <managed-bean-name> equal to the id in the jsp:useBean tag but drew the an error indicating the the <jsp:useBean ...> tag had instantiated the class before the faces-config.xml file had -- hence the managed property could not be found.
    I also tried putting name="entryHandler" in the <jsp:useBean > tag, but this is not allowed.
    Hmm, how to get the <managed-bean> and <jsp:useBean> to match?
    Maybe i have to put in code to the effect "get context " "get instantiation" etc,
    I'll have to try looking it up . . .

  • Managing Multiple threads accessing  a single instance of a class

    Hi,
    i have to redesign a class, say X, in such a way that i manage multiple threads accessing a single instance of the class, we cannot create multiple instances of X. The class looks like this:
    Class X{
    boolean isACalled=false;
    boolean isInitCalled=false;
    boolean isBCalled=false;
    A(){
    isACalled=true;
    Init(){
    if(!isACalled)
    A();
    B();
    C();
    isInitCalled=true;
    B(){
    if(!isACalled)
    A();
    isBCalled=true;
    C(){
    if(!isACalled)
    A();
    if(!isBCalled)
    B();
    }//end of class
    Init is the method that would be invoked on the single instance of this class.
    Now i cannot keep the flags as instance variables coz different threads would have differrent status of these flags at the same time, hence i can make them local, but if i make them local to one method, the others won't be able to check their status, so the only solution i can think of is to place all the flags in a hashtable local to method INIT AND INITIALIZE ALL OF them to false, as init would call other methods, it would pass the hashtable reference as an additional parameter, the methods would set the flags in the hashtable and it would be reflectecd in the original hashtable, and so all the methods can have access to the hashtable of flags and can perform their respective checks and setting of flags.
    This all would be local to one thread, so there's no question of flags of one thread mixin with the flags of some other thread.
    My question is :
    Is this the best way, would this work?
    In java, everything is pass by value, but if i pass the hashtable reference, would the changes made inside the called method to the hashtable key-value would be visible in the original hashtable declared inside the calling method of which the hashtable is local variable?

    In Java object variables are passed "by copy of reference", and primitive variables "by value".
    The solution with HashMap/Hashtable you suggest is ok, but I think you should read about ThreadLocal class:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ThreadLocal.html

  • How to access an object in a bean

    I am looking for a way to access an object in a bean and make available to the page.
    for example if i have a Bean called User and it contains an attribute Called Company as an attribute in User. Now I have User.getCompany(). and I can do this
    <%User user = request.getUser();
    Company company = user.getCompany();
    request.setAttribute("comp", company); %>
    how do I do this with useBean ?

    I am looking for a way to access an object in a bean
    and make available to the page.
    for example if i have a Bean called User and it
    contains an attribute Called Company as an attribute
    in User. Now I have User.getCompany(). and I can do
    this
    <%User user = request.getUser();
    Company company = user.getCompany();
    request.setAttribute("comp", company); %>
    how do I do this with useBean ?You can access a JavaBean Object property of another JavaBean inside the JSP with the use of EL (Expression Language)
    So if you are using JSP 2.0 or higher try this:
    <jsp:useBean id="user" class="your.package.User" scope="request"/>
    ${user.company.id}I tested the above and it works.
    Note that you need to set the Company object in the User object before trying to access it inside the JSP.
    You can also set it in the JSP if you want, (before trying to access it), but its cleaner to do it in a Servlet.
    Both User and Company must follow JavaBeans notation.
    So in the above case the User object is something like this:
    package your.package;
    public class User{
       private Customer customer;
       public User(){}
       public Customer getCustomer(){
          return customer;
       public void setCustomer(Customer customer){
         this.customer = customer;
    }And your Customer JavaBean is something like this:
    package your.package;
    public class Customer{
       private int id;
       public Customer(){}
       public int getId(){
         return this.id;
       public void setId(int id){
         this.id = id;
    }

Maybe you are looking for

  • How to transfer a calendar items from one month to another

    How can one transfer a calendar item from one month to another month by drag and drop.

  • Would like to redirect page

    Hi All, First, I'm not a java programmer at all... Okay.. I have this portal with an ExceptionHelper.java file and instead of displaying this page to the user, I'd like to redirect the page to an HTML page, perhaps carrying a variable for the error w

  • XSLT Tranformation problem - empty output lines

    Hi experts, I have a following problem with the XSLT transformation.   FIELD-SYMBOLS: <tab> TYPE table,                  <line> TYPE ANY,                  <tabz> TYPE ANY TABLE.    CREATE DATA a_table LIKE i_table.   ASSIGN a_table->* TO <tabz>.   GE

  • Changing order line item move-out date

    Hi All, I am pretty new on the CRM end. I have a requirement where- in i need to change the move-out date on the order line item. Could someone help me out what needs to be done in order to achieve the desired functionality. Thanks, Im

  • Requied field in pdf?

    hi in acrobT XI you can use the option for a field to be requierd. but when somone igonere som fields whil filling the form He can send the form anyway. Is there a solution to prevent that to happen?