Working with Active Classes on JVM

I would like to see an example of where one class with a simple data field, such as an integer, can be read in through the JVM and the value of that integer can be determined in a different class with no references between the two classes. The classes cannot communicate at all. The class getting the value must determine the value by accessing the data stored in the JVM heap or memory area.
Thanks for the help.

I would like to see an example of where one class with
a simple data field, such as an integer, can be read
in through the JVM and the value of that integer can
be determined in a different class with no references
between the two classes. The classes cannot
communicate at all. The class getting the value must
determine the value by accessing the data stored in
the JVM heap or memory area.Nothing between the two classes?
Simple. Create a third class and it refers to the first two.
Or perhaps use the debugging api (which in a single VM means that you will need to use JNI.)

Similar Messages

  • Does WLS 6.1 LDAP work with Active Directory?

    I see in the security docs that Microsoft Site Server LDAP is supported. Anyone
    know if it will work with Active Directory which is supposed to be LDAP v3 compatible?
    TIA

    I've done it with :
    <CustomRealm
    ConfigurationData="server.host=myLDAP.mydomain.org;membership.filter=(&
    (member=%M)(objectclass=group));server.port=389;group.dn=ou=groupes,dc=myDomain.org;group.filter=(&(cn=%g)(objectclass=group));server.principal=cn=Administrator,cn=Users,dc=myDomain.org;user.dn=ou=Utilisateurs,dc=myDomain.org;user.filter=(&(cn=%u)(objectclass=person));server.ssl=false"
    Name="MyLDAPv2" Notes="Test ldap V2 active Directory"
    Password="myPassword" RealmClassName="weblogic.security.ldaprealmv2.LDAPRealm"/>
    Will Spies <[email protected]> wrote:
    Can you put up what a sample <CustomRealm/> tag for AD looks like? I'm
    trying to get this to work with no success. Thanks for any help.

  • Can't get extended class to work with asbstract class

    I am having trouble working an extended class to work with my base abstract class. I keep getting this error message: "Fiction.java:4: invalid method declaration; return type required" public FictionBook()" Can someone give me some advice and or guidance on what I need to do? Thanks.
    Here is my abstract class:
    import javax.swing.*;
    public abstract class Book
         protected String bookTitle;
         protected double bookPrice;
         public abstract double setPrice();
    public Book()
              setBookPrice();
    public double getBookPrice()
              return bookPrice;
    public abstract void setBookPrice();
    Here is the extended class that I have:
    import javax.swing.*;
    public class Fiction extends Book
         public Fiction()
              super();
              setBookPrice();
         public void setBookPrice();
              bookPrice = 24.95;
         public String toString()
              return("Fiction Book Price is $" + bookPrice);
    }

    Fiction.java:2: Fiction is not abstract and does not override abstract method setPrice() in BookThis one is pretty straightfoward: Book declares an abstract setPrice() method. In effect is promises "every concrete subclass of Book will define an implementation of setPrice()". But your Fiction class does not do this - it does not give an implementation of setPrice() even though as a Book it is required to do so. That is what the compiler is complaining about.
    Fiction.java:6: call to super must be first statement in constructorThis one is slightly cryptic. If you use super() it must be as the first line of a constructor. You are using it as the first line of Fiction() so that looks OK - until you realise that Fiction() is not a constructor! That's because you declare it as a method returning void. Remove the "void" and the compiler will recognise it as a constructor and will be happy about your use of super().
    Edited by: pbrockway2 on Sep 13, 2008 12:13 PM
    Just a general point: it might be worth writing very brief comments for your abstract class to say what the methods are supposed to do. It isn't really clear what setBookPrice() is supposed to do given that it isn't passed any argument. Likewise setPrice(), how does it differ from setBookPrice()? what is the double value that it returns?

  • ThinkPad X60 Replacement Hard Drive - Will free fall sensor work with Active Protection System?

    I plan to replace the OEM hard drive on my ThinkPad X60 with a Western Digital Scorpio Black drive. I found a board posting on Scott Mueller's Upgrading and Repairing Forum site that seems to indicate that APS will work with this drive. Here is my question: Is there any point in purchasing the drive with the free fall sensor option? (This is more expensive than the drive without the sensor.)  Will this provide any additional protection above and beyond the Active Protection System. Will the internal free fall sensor in the drive be compatible with APS?  In other words, should I buy a Scorpio Black with or without the free fall sensor?
    Thanks!

    Welcome to the forum!
    If I were buying a replacement drive, I'd get one without a sensor, but that's me.
    Having seen way too many laptops that have gone through a real "free fall" I'll say that a damaged hard drive in such an event is usually the least of one's problems...
    Good luck.
    Cheers,
    George
    In daily use: R60F, R500F, T61, T410
    Collecting dust: T60
    Enjoying retirement: A31p, T42p,
    Non-ThinkPads: Panasonic CF-31 & CF-52, HP 8760W
    Starting Thursday, 08/14/2014 I'll be away from the forums until further notice. Please do NOT send private messages since I won't be able to read them. Thank you.

  • Safari 5.1.5 doesn't work with my Class 1 digital id

    Several days ago I discovered that my VeriSign digital id certificate no longer works with the safari browser. It functions perfectly on my windows based pc using the safari browser.  It also functions perfectly in firefox and IE. 
    I am wondering if this is an issue that stems from the most recent update to safari 5.1.5.  Verisign tech support believes that the issue may be caused by the 34Bit encryption required by Safari.  Has anyone else experienced similar issues? Is there a fix or solution?

    Several days ago I discovered that my VeriSign digital id certificate no longer works with the safari browser. It functions perfectly on my windows based pc using the safari browser.  It also functions perfectly in firefox and IE. 
    I am wondering if this is an issue that stems from the most recent update to safari 5.1.5.  Verisign tech support believes that the issue may be caused by the 34Bit encryption required by Safari.  Has anyone else experienced similar issues? Is there a fix or solution?

  • Failover agents who work with active directory integration

    Hi Guys,
    I have implemented 'Active Directory' failover in SCOM. But what i see is that it doesn't work.
    The agents are assigned by AD, but the first (RMS Role) management server has got all the agents and is to busy and
    has got many problems to handle all the load. Even with this case nothing is failing over.
    A few i could failover with hand, but the most i cannot because 'change primary management' server is blanked out. Even with the agents turned back from manuel to automatic (blog Kevin Holman).
    1. Has anybody got any idea of getting the AD failover to work automatic?
    2. Has anybody got a workaround to do this manual, by powershell (SCOM 2012 R2 cmdlets), bypassing the grayed out 'Change primary management server?
    3. In my failover screen is see the management servers + the internet DMZ gateway server. I don't want to failover to the internet DMZ Gateway server. Can i delete this?
    Please have a look at my specific question. I did read many blogs who are based on powershell without AD integration or AD integration without explaining how the automatic failover works.
    Kind regards,
    André

    Hi,
    SCOM windows agents automatic failover does not require AD integration or PowerShell scripting or Configuration Manager or manual agents installation specially for small to medium environment and agents distribution between different SCOM management servers
    can be accomplished through push agents wizard, and windows agents failover can be simply verified from event viewer.
    Please refer to the below links for more details:
    How to Use Active Directory Domain Services to Assign Computers to Management Servers
    http://technet.microsoft.com/en-us/library/hh212712.aspx
    OpsMgr AD Integration - how it works
    http://blogs.msdn.com/b/steverac/archive/2008/03/20/opsmgr-ad-integration-how-it-works.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Hp elite l2201x wont work with active converter

    i bought the 
    StarTech.com HDMI2DP HDMI or DVI to DisplayPort Active Converter
    these are the specs :
    The HDMI2DP DVI or HDMI to DisplayPort Converter converts an HDMI, DVI or Mini DVI input signal into a DisplayPort (or Mini DisplayPort) output, eliminating the cost of upgrading your source device hardware or purchasing a new display. With support for full HD resolutions up to 1920x1200, the HDMI2DP converter is the perfect solution for connecting devices that have an HDMI, DVI single-link or mini DVI output, such as video cards (desktop or laptop), video game consoles or home theater receivers, to your DisplayPort-capable display
    THIS SHOULD WORK FOR THIS MONITOR RIGHT? BECUASE ITS NOT!

    Hi,
    Just return it (the adapter) and get your money back.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Arrays that work with Java Class

    Good Day all.
    Currently, I am working on a program that is giving me a bit of trouble starting...can anyone give me assistance and try to tell me what I am doing incorrectly?
    Here is the tasking:
    Main Method
    1. Output statement to screen saying this program will accept hours worked for 3 employees.
    2. Declare an Integer Array to hold 3 employees hours. Call this array "employees"
    3. Main Method then calls inputData Method (Passing array as argument) do not accept any return value.
    4. Main Method then calls outputData Method (Passing array as argument) do not accept any return value.
    import java.util.*;
    import java.text.DecimalFormat;
    public class Arrays
    { /*This starts the Arrays*/
         public static void main (String[] args)
         Scanner scannerObject = new Scanner(System.in);
         Scanner keyboard = new Scanner(System.in);
    inputData(employees);
         System.out.println("This program will accept hours worked for 3 employees.");
         String[]employees = new String [3];

    How am I coming along....I started with the MAIN Method...Now I have started and created a MONSTER with this other portion of my program
    Main Method
    1. Output statement to screen saying this program will accept hours worked for 3 employees.
    2. Declare an Integer Array to hold 3 employees hours. Call this array "employees"
    3. Main Method then calls inputData Method (Passing array as argument) do not accept any return value.
    4. Main Method then calls outputData Method (Passing array as argument) do not accept any return value.
    InputData Method (Receives Arrary)
    1. Gers input using a for loop for each employees hours into the array elements.
    2. Prompt the user with the following phrase. Enter hours worked for employee #: (Where # is the employee number 1-3)
    Can anyone tell me what is going god awfully wrong with this program? LAUGHING
    SUSAN
    import java.util.*;
    import java.text.DecimalFormat;
    public class CS219Arrays
    { /*This starts the Arrays*/
    public static void main (String[] args)
    Scanner scannerObject = new Scanner(System.in);
    Scanner keyboard = new Scanner(System.in);
    int numberOfHours = 0;
    System.out.println("This program will accept hours worked for 3 employees.");
    String[]employees = new String [3];
    for (int index = 0; index < employees.length; index ++)
    System.out.println(employee[index]);
    /*** Used to get input from the user and store the results in an array
    @param employees The array to store the data that the user enters in*/
    public static void inputData(String[] employees) {
    // Get user input and place it in the employees array
    /*** Used to output the data @param employees the array to output*/
    private static void outputData(String[] employees) {
    // Display each element of the employees array
    System.out.println("Enter hours worked for employee #: (where # is the employee number 1-3)");
    numberOfHours = keyboard.nextInt();
    }

  • Getting grid layout to work with a class that extends JFrame

    In my code, I have a class extending JFrame and setting the layout to grid works and the code to add with three parameters compiles just fine but when I run it I get this:
    java.lang.IllegalArgumentException: illegal component position
         at java.awt.Container.addImpl(Container.java:999)
         at java.awt.Container.add(Container.java:928)
         at javax.swing.JFrame.addImpl(JFrame.java:479)
         at java.awt.Container.add(Container.java:928)
    on the add(myLabel, 1, 1); line

    I see on these from
    http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Container.html#add(java.awt.Component)
    1.public Component add(Component comp)
    2.public Component add(String name, Component comp)
    3.public Component add(Component comp, int index)
    you should use method add(...) of JPanel instead

  • Getting Mobile Accounts to work with Active Directory

    Just curious to see if anyone got this to work. I am running OSX server version 10.4.4. I binded the server via directory access to our Active Directory Domain. I could see the active directory accounts in Workgroup manager and was able to get client Mac systems to log in using their AD account info. When I tried to set up the accounts as mobile accounts I ran into probelms. When you enter your login info on the client end, the screen would just go to a blnak blue desktop and not get any further. Anyone have any luck getting their AD accounts set up on the client Macs running as mobile directories?

    Heh. Yeah, and tried switching it on and off a few times, too.
    I think I might have found the problem, but I think I might have also borked my ability to play with it tonight -- in the Advanced Rules section in the firewall settings, there were a bunch of "deny" rules in there that weren't enabled... I guessed that those needed to be turned on, so that it would deny everything by default, but then allow the stuff I want through (set on the other page).
    Except after enabling those, I now can't connect to the server with ARD any more. Oops.
    The good news is that at least I also can't mount AFP shares from here any more either.
    The bad news is that when logging into the MacBook now, with my mobile account, it still starts up the Home Sync process on login (after spending about 35 seconds doing nothing after entering the password), and then hangs there for about 2 minutes trying to contact the sync server before giving up and continuing with the login properly -- this is what I was hoping to avoid.

  • Std::list::sort() doesn't work with custom class

    The following example doesn't order a list the way I'd expect. Is this being done wrong? Sun Studio 12 (not update 1). Current patches as of Monday.
    #include <list>
    class CMyClass
    public:
    CMyClass(long a) : m_Sec(a) { }
    bool operator<(const CMyClass* rhs)
    return (m_Sec < rhs->m_Sec);
    long m_Sec;
    typedef std::list<CMyClass*> TLogList;
    int
    main(int argc, char* argv[])
    TLogList logList;
    CMyClass* name = new CMyClass(0x4A833E79);
    logList.push_back(name);
    name = new CMyClass(0x4A85E144);
    logList.push_back(name);
    name = new CMyClass(0x4A85E66F);
    logList.push_back(name);
    name = new CMyClass(0x4A85E66F);
    logList.push_back(name);
    name = new CMyClass(0x4A85B2C2);
    logList.push_back(name);
    name = new CMyClass(0x4A85D6EF);
    logList.push_back(name);
    name = new CMyClass(0x4A69F9AD);
    logList.push_back(name);
    name = new CMyClass(0x4A85DC92);
    logList.push_back(name);
    name = new CMyClass(0x4A817316);
    logList.push_back(name);
    name = new CMyClass(0x4A85DEEB);
    logList.push_back(name);
    name = new CMyClass(0x4A846329);
    logList.push_back(name);
    name = new CMyClass(0x4A85E39D);
    logList.push_back(name);
    name = new CMyClass(0x4A85D41D);
    logList.push_back(name);
    name = new CMyClass(0x4A89CC17);
    logList.push_back(name);
    name = new CMyClass(0x4A85DC19);
    logList.push_back(name);
    logList.sort();
    TLogList::iterator logListIter = logList.begin();
    TLogList::iterator logListEnd = logList.end();
    for (; logListIter != logListEnd; ++logListIter)
    CMyClass* name = *logListIter;
    cout << hex << name->m_Sec << endl;
    return 0;
    which produces
    4a833e79
    4a85e144
    4a85e66f
    4a85e66f
    4a85b2c2
    4a85d6ef
    4a69f9ad
    4a85dc92
    4a817316
    4a85deeb
    4a846329
    4a85e39d
    4a85d41d
    4a89cc17
    4a85dc19

    The program as you wrote it will sort the contents of the list. The list consists of the addresses of CMyClass objects, and after sorting, will contain those addresses in sorted order.
    If you want to sort by the contents of the classes that are pointed to, you need to provide a comparison operator that compares the contents, and use the other form of the list::sort function that takes a comparison function as an argument. That is, add the function
    bool comp(const CMyClass* l, const CMyClass* r)
       return l->m_Sec < r->m_Sec;
    }and change
    logList.sort(); to
    logList.sort(comp); This version of list::sort will not compile using the default libCstd, because it requires member templates in the library implementation. For more information about this limitation, refer to the C++ FAQ section on library compatibility.
    [http://developers.sun.com/sunstudio/documentation/ss12u1/mr/READMEs/c++_faq.html#LibComp]
    The revised code will compile with the optional STLport library, or with other 3rd-party libraries like Apache stdcxx. To use STLport, add the option -library=stlport4 to every CC command, compiling and linking. You cannot mix code compiled for the default libCstd with STLport code in the same program.

  • Working with 2 classes

    Hello!
    I am learning Java so I hope you can help me. I am having 2 java files.
    1.Frame.java
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Frame extends JPanel {
    public Component create() {
    JButton button = new JButton("Button");
    JButton cancel = new JButton("Cancel");
    button.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
    cancel.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.exit(0);
    JPanel pane = new JPanel();
    pane.add(button);
    pane.add(cancel);
    return pane;
    public static void main(String[] args) {
    JFrame okvir = new JFrame("Frame");
    Frame app = new Frame();
    Component content = app.create();
    okvir.getContentPane().add(content, BorderLayout.CENTER);
    okvir.pack();
    okvir.setVisible(true);
    and Modal.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import swing.Frame;
    public class Modal {
    In frame I have two buttons."Cancel" buttons
    and "button".When I click on "button" button I want to open modal window.I dont know how to do it.
    Can somebody help me.
    Tnx.
    Kokolo

    hi Kokolo,
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class MyFrame extends Frame {
    public ModalDialog dialogBox;
    public static MyFrame myFrame;
    public MyFrame(String title) {
    super(title);
    public Component create() {
    Button button = new Button("Button");
    Button cancel = new Button("Cancel");
    button.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
    // this (reference to the frame)
    // "Modal Dialog" is the title
    // true means its modal
    dialogBox = new ModalDialog(myFrame, "Modal Dialog", true);
    dialogBox.show();
    cancel.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.exit(0);
    Panel pane = new Panel();
    pane.add(button);
    pane.add(cancel);
    return pane;
    public static void main(String[] args) {
    myFrame = new MyFrame("Frame");
    Component content = myFrame.create();
    myFrame.add(content, BorderLayout.CENTER);
    myFrame.pack();
    myFrame.setVisible(true);
    class ModalDialog extends Dialog {
    private Button clickMeButton;
    public ModalDialog(Frame parent, String title, boolean modal) {
    super(parent, title, modal);
    setSize(200, 200);
    setUpDialogBox();
    private void setUpDialogBox() {
    clickMeButton = new Button("Click me!");
    add(clickMeButton, BorderLayout.CENTER);

  • Working with ObjectOutputStream

    I am working with the class ObjectOutputStream, but I dont know what the file extension is that I am working which. Can anyone tell me the type of file this output stream creates?

    Create an ObjectOutputStream over a FileOutputStream, the name in the latter can be anything
    FileOutputStream fos = new FileOutputStream ("myfile.any");
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(obj);
    ...

  • BAM Data Control - Group query with Active Data Service

    Trying to get a group query from a BAM data control to work with Active Data Service in an ADF application (JDeveloper 11.1.1.4.0).
    With a flat query, as the data changes, I can see DataChangeEvents fired, resulting in a data push to the client -
    <BAMDataChangeEventFilter> <log>
    #### DataChangeEvent #### on [DataControl name=CEP_Person_DOB_Flat, binding=data.view_mainPageDef.FlatDOB1.view_pageDefs_FlatDOBViewPageDef_WEB_INF_FlatDOB_xml_FlatDOB.QueryIterator]
    Filter/Collection Id : 1966
    Collection Level : 0
    Event Id : 5
    ==== DataChangeEntry (#1)
    ChangeType : INSERT_AFTER
    KeyPath : [2157, 0]
    InsertKeyPath : [null, 0]
    AttributeNames : [id, _PersonKey, _County, _Surname, _AGE, _DOB, _Country, _FirstName]
    AttributeValues : [2157, 10008/129, Vagzukarbsm, Gnnfzxxyqfgpsijcr, 110, Thu Dec 26 00:00:00 GMT 1901, Ekcqvrkoksr, Vwhm]
    When I try a group query on the same data, currently just trying to group by _DOB for every 10 years to count the number of people, I get no data change events fired, so don't get any data pushed to the client, though the data has been changed if I refresh the page.
    Any ideas ?

    can you include bam and jdev versions and also include exception from logs?

  • Working with JTextArea and things like that

    I don't know if this is the right subforum for this.. if not, feel free to move it over to another subforum
    Now i have this exercise.
    I made a file for it , a list.data file. If i run the program, it gives the info in the list.data file in a whole new box.
    So this is in the data file for example:
    Toyota
    Hilux
    Volkswagen
    Rabbit
    Jeep
    Wrangler
    Than if i run the program, it opens a new window and then there is in it:
    Toyota
    Hilux
    Volkswagen
    Rabbit
    Jeep
    Wrangler
    Now the assingment is to create a new car class with the relevant instance variables (just to store the property values i assume). And thereby i have to create relevant methods to access the instance variables. I also have to create a constructor that accepts initial values for the car instance variables.
    The given program is working with two classes. Those are given, i don't need to understand their internal details, says the exercise
    This is a whole new part of Java for me. Can someone give me an example or a hint or something like that?
    Can i just make a new class with in it the car information
    so like:
    import java.util.*;
    public class CarInformation {
        String[] brand = new String[5];
        String[] type  = new String[5];
        public void brands(){
            brand[0]   = "Toyota";
            brand[1]   = "Volkswagen";
            brand[2]   = "Jeep";
        public void types(){
            type[0]    = "Hilux";
            type[1]    = "Rabbit";
            type[2]    = "Wrangler";
        public CarInformation() {
    }If this is right, how can i make the bigger program to read from my new CarInformation class? I think i'm in the dark..

    newbeeinjava wrote:
    Hmm, it is not my intention to get on your nerves..You aren't! Sorry if my post sounded that way.
    My comments are inline:
    import java.util.*;
    public class Car{
        String Brand;
        String Type;
        String Car;    // this isn't needed. the brand and type are the only attributes of a car you need, right?
    // setting the initial values of brand and type is done by the constructor, you don't need these
    //    public void Brands(){
    //        //reserved to store intital markings for Brand variable
    //    public void Types(){
    //        //reserved to store intital markings for Type variable
        // constructors have to have the same name as the class, not CarBrand, or CarType
    /*    public void CarBrand(String Brand) {
            this.Brand = Brand;
    // this is right
        public String getBrand() {
            return Brand;
    /*    public void CarType(String Type) {
            this.Type  = Type;
    // this is right
        public String getType() {
            return Type;
        // change this method name to Car so that it's a constructor. once that's done, it's correct
        public void CarSpecs(String Brand, String Type){  //this one if we can get both Brand and Type in with one method?
            this.Brand = Brand;
            this.Type  = Type;
    // this works too, but you'll want to add a space between the brand and type
            public String getCarSpecs() {
            return Brand + Type;
        public static void main(String[] args) {
    //        new Car().getCarSpecs();
              Car someCar = new Car("honda", "civic");    // create a new car with "honda" and "civic" as the brand and type
              String theSpecs = someCar.getCarSpecs();    // get the specs String from that car
              System.out.println(theSpecs);     // print those specs
    }

Maybe you are looking for