Wait on multiple objects (events)

Hi all, I am porting some libraries from C# to Java, and i have this littlle problem here:
I have a Producer-Consumer api that end the Consumer thread waits for two events: NewData and Exit
Is there a wauy to wait simulaneusly for two objects?
NOTE: On C# y used WaitHandle.WaitAny(EventWaitHandle[])I can make a class to store the event data, and set a parameter indicating what event was rised, but y preffer to ask you people first
Thanks!
Juan

ichramm wrote:
Hi all, I am porting some libraries from C# to Java, and i have this littlle problem here:
I have a Producer-Consumer api that end the Consumer thread waits for two events: NewData and Exit
Is there a wauy to wait simulaneusly for two objects?
If the meaning of "+Exit+" is to break out of the processing loop, then the obvious answer is: use thread.interrupt() which was made for exactly this purpose. Catch the InterruptedException in your processing thread, reset the interrupt state and exit gracefully from the thread.

Similar Messages

  • Job not getting triggered for Multiple Scheduler Events

    hi,
    I would like a job to be triggered for multiple scheduler events, subscribing to a single event works fine. But, when I set multiple event condition, nothing works.
    My objective is to run a job, whenever job starts or restarts or exceeds max run duration.
    Note : Is it possible to trigger a job, when a job RESTARTS by subscribing to JOB_START ????????
    procedure sniffer_proc(p_message in sys.scheduler$_event_info)
    is
    --Code
    end sniffer_proc
    dbms_scheduler.create_program(program_name => 'PROG',
    program_action => 'sniffer_proc',
    program_type => 'stored_procedure',
    number_of_arguments => 1,
    enabled => false);
    -- Define the meta data on scheduler event to be passed.
    dbms_scheduler.define_metadata_argument('PROG',
    'event_message',1);
    dbms_scheduler.enable('PROG');
    dbms_scheduler.create_job
    ('JOB',
    program_name => 'PROG',
    * event_condition => 'tab.user_data.event_type = ''JOB_OVER_MAX_DUR''' ||*
    *' or tab.user_data.event_type = ''JOB_START''',*
    queue_spec => 'sys.scheduler$_event_queue,auagent',
    enabled => true);
    I tried this too...
    dbms_scheduler.create_job
    ('JOB',
    program_name => 'PROG',
    * event_condition => 'tab.user_data.event_type = ''JOB_OVER_MAX_DUR''' ||*
    *' and tab.user_data.event_type = ''JOB_START''',*
    queue_spec => 'sys.scheduler$_event_queue,auagent',
    enabled => true);
    Need help
    Thanks...
    Edited by: user602200 on Dec 28, 2009 3:00 AM
    Edited by: user602200 on Dec 28, 2009 3:03 AM

    Hi,
    Here is complete code which I tested on 10.2.0.4 which shows a second job that runs after a first job starts and also when it has exceeded its max run duration. It doesn't have the condition but just runs on every event raised, but the job only raises the 2 events.
    Hope this helps,
    Ravi.
    -- run a job when another starts and exceeds its max_run_duration
    set pagesize 200
    -- create a user just for this test
    drop user test_user cascade;
    grant connect, create job, create session, resource,
      create table to test_user identified by test_user ;
    connect test_user/test_user
    -- create a table for output
    create table job_output (log_date timestamp with time zone,
            output varchar2(4000));
    -- add an event queue subscriber for this user's messages
    exec dbms_scheduler.add_event_queue_subscriber('myagent')
    -- create the first job and have it raise an event whenever it completes
    -- (succeeds, fails or stops)
    begin
    dbms_scheduler.create_job
       ( 'first_job', job_action =>
         'insert into job_output values(systimestamp, ''first job runs'');'||
         'commit; dbms_lock.sleep(70);',
        job_type => 'plsql_block',
        enabled => false, repeat_interval=>'freq=secondly;interval=90' ) ;
    dbms_scheduler.set_attribute ( 'first_job' , 'max_runs' , 2);
    dbms_scheduler.set_attribute
        ( 'first_job' , 'raise_events' , dbms_scheduler.job_started);
    dbms_scheduler.set_attribute ( 'first_job' , 'max_run_duration' ,
        interval '60' second);
    end;
    -- create a simple second job that runs when the first starts and after
    -- it has exceeded its max_run_duration
    begin
      dbms_scheduler.create_job('second_job',
                                job_type=>'plsql_block',
                                job_action=>
        'insert into job_output values(systimestamp, ''second job runs'');',
                                event_condition =>
       'tab.user_data.object_name = ''FIRST_JOB''',
                                queue_spec =>'sys.scheduler$_event_queue,myagent',
                                enabled=>true);
    end;
    -- this allows multiple simultaneous runs of the second job on 11g and up
    begin
      $IF DBMS_DB_VERSION.VER_LE_10 $THEN
        null;
      $ELSE
        dbms_scheduler.set_attribute('second_job', 'parallel_instances',true);
      $END
    end;
    -- enable the first job so it starts running
    exec dbms_scheduler.enable('first_job')
    -- wait until the first job has run twice
    exec dbms_lock.sleep(180)
    select * from job_output;

  • Using Async to wait for a specific event

    I've simplified the creation and deletion calls and used a generic item.  In my before method, I call Async.handleEvent to wait for PropertyChangeEvents, but this only waits for the first one.  My problem lies in the fact that ItemManager is an IEventDispatcher that sends multiple property change events, but I need to wait for the specific event with the property "item".  However, when I call Async inside the handler, it does not keep the Test method from running, Before assumes that it's Async responsibilities have been fulfilled and launches the next stage of tests.  How can I keep Before from moving on until an event with a specific property has been received?
    public class Test
            private static const TIME_OUT:int = 3000;
            [Before(async)]
            public function runBeforeEveryTest() : void
                // Create a new item
                item.create();  // This is an asynchronous creation that sends many Property Change events
                //Wait for the item to be created before continuing tests.
                Async.handleEvent( this, ItemManager.instance, PropertyChangeEvent.PROPERTY_CHANGE, handlePropertyChangeForItem, TIME_OUT);
            [After]
            public function runAfterEveryTest() : void
                // Delete the Item
                item.delete();
            [Test(async)]
            public function itemExists() : void
                      Assert.assertTrue( item.exists() );
           private function handlePropertyChangeForItem(evt:PropertyChangeEvent, eventObject:Object) : void
                 if (evt.property == "item")
                     // Now that the item has been created, we can start the tests.
                     return;
                 else
                     // Keep waiting.
                     Async.handleEvent( this, ItemManager.instance, PropertyChangeEvent.PROPERTY_CHANGE, handlePropertyChangeForItem, TIME_OUT);
    Thanks in advance, it's greatly appreciated!

    I can't reproduce this issue. All seems to be working fine with multiple deferred Async calls. I am pasting my code in. Since I did not have your manager, I tried to repiicate this with a timer. If you could look at my code and see if it differs from yours in a significant way, I can take another shot, but it seems to be working as expected.
    package  
    import flash.events.TimerEvent; 
    import flash.utils.Timer; 
    import mx.events.PropertyChangeEvent; 
    import org.flexunit.Assert; 
    import org.flexunit.async.Async; 
    public class NestedAsync { 
    private static const TIME_OUT:int = 3000; 
    private var timer:Timer; 
    Before(async)]
    public function runBeforeEveryTest() : void {   timer =
    new Timer( 1000, 5 ); 
      Async.handleEvent(this, timer, TimerEvent.TIMER, handleTimerTick, TIME_OUT);timer.start();}
    [After]
    public function runAfterEveryTest() : void {  timer.stop();
      timer =
    null;}
    Test(async)] 
    public function itemExists() : void {Assert.assertTrue(
    true );}
    private function handleTimerTick(evt:TimerEvent, eventObject:Object) : void {  
      if ( timer.currentCount == 5 ) { 
        // Now that the item has been created, we can start the tests. 
        return;  }
      else  { 
        // Keep waiting.    Async.handleEvent(
    this, timer, TimerEvent.TIMER, handlePropertyChangeForItem, TIME_OUT);
    suite.cases { 

  • Re: Service Object events and LockMgr

    On the option that you have considered, I have implemented the same model
    in my previous project (using Java/RMI), but I felt that it is more than
    what is normally needed for concurrency protection.
    I can suggest another option that is worth considering which is in place in
    our app for concurrency.
    Almost every table in our db has created By, created On, modifed By,
    modified On columns. The parent class of all business objects has
    attributes that correspond to these four columns. In addition to these
    four, there is a fifth attribute (introduced when concurrency was built)
    called originalModifiedOn. Upon retrieval from the db, it is set to
    modifiedOn value (from the db), during UPDATE, the value in this column is
    added part of the WHERE clause. So when the second user tried to do save
    the same object, the underlying db update will get a 'zero rows updated'
    which is translated into an application error 'possible concurrency
    error'. The user re-retreives the now 'stale' object before applying their
    edits.
    A lot of these things are and can be built into the framework imposing very
    little work that each Object needs to do to have concurrency protection.
    I am not sure if there is a mention in the Patterns paper of this model,
    but it is very easy to implement and supports what is needed.
    Kishore Puvvada's Mail
    [email protected] on 07/28/99 01:47:00 AM
    To: [email protected]@INTERNET
    cc: (bcc: Kishore Puvvada/HQ-IS/TAL)
    Subject: Service Object events and LockMgr
    Hi folks,
    We're currently looking at strategies for dealing with the simultaneous
    updates to the database from multiple clients (concurrency
    management). That is when two (or more) clients load the same object to
    edit it, then make different changes and save them to the database.
    We have a copy of a Forté document (from the "Patterns" course, I
    think) which describes three methods of dealing with this:
    1) Lock the database table row as soon as a client select it for editing
    and hold the lock until it is saved.
    2) Immediately before 'saving' check that the database hasn't changed
    (either by reading what's there before updating, or by using a huge
    'where' clause that contains all unchanged fields)
    3) The Forté "LockMgr" pattern, which uses a service object with notifier
    proxies to allow locking and updating notification between the clients.
    Option 3 is obviously the most robust method, but it requires a fair
    amount of coding and could also be a bottleneck for database reads and
    writes.
    But I have another option for which I was looking for opinions. What if
    we had a "Change Event manager" which broadcast an event every time
    a change is made to the database. Each business class would have its
    own event. If the event had the object's primary key as a parameter, then
    clients editing that particular object type could check to see if the object
    currently on screen is the one that changed. That way you could disable
    the 'save' until they had refreshed their on-screen data.
    It's not particularily elegant, but it's reasonably simple to implement. It
    also deals with changes sent across our WAN from other database
    servers.
    But this option is only worthwhile if you can replicate the "Change Event
    manager" SO and still register for an event on the client. Can clients
    register for SO events and receive an event generated by any of the SO's
    replicates? Or when you register for an SO's event do you register for
    only one instance of the SO?
    Thanks in advance for any answers.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email:
    [email protected]
    PO Box 764, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10
    years
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:
    http://pinehurst.sageit.com/listarchive/forte>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/forte>

    On the option that you have considered, I have implemented the same model
    in my previous project (using Java/RMI), but I felt that it is more than
    what is normally needed for concurrency protection.
    I can suggest another option that is worth considering which is in place in
    our app for concurrency.
    Almost every table in our db has created By, created On, modifed By,
    modified On columns. The parent class of all business objects has
    attributes that correspond to these four columns. In addition to these
    four, there is a fifth attribute (introduced when concurrency was built)
    called originalModifiedOn. Upon retrieval from the db, it is set to
    modifiedOn value (from the db), during UPDATE, the value in this column is
    added part of the WHERE clause. So when the second user tried to do save
    the same object, the underlying db update will get a 'zero rows updated'
    which is translated into an application error 'possible concurrency
    error'. The user re-retreives the now 'stale' object before applying their
    edits.
    A lot of these things are and can be built into the framework imposing very
    little work that each Object needs to do to have concurrency protection.
    I am not sure if there is a mention in the Patterns paper of this model,
    but it is very easy to implement and supports what is needed.
    Kishore Puvvada's Mail
    [email protected] on 07/28/99 01:47:00 AM
    To: [email protected]@INTERNET
    cc: (bcc: Kishore Puvvada/HQ-IS/TAL)
    Subject: Service Object events and LockMgr
    Hi folks,
    We're currently looking at strategies for dealing with the simultaneous
    updates to the database from multiple clients (concurrency
    management). That is when two (or more) clients load the same object to
    edit it, then make different changes and save them to the database.
    We have a copy of a Fort&eacute; document (from the "Patterns" course, I
    think) which describes three methods of dealing with this:
    1) Lock the database table row as soon as a client select it for editing
    and hold the lock until it is saved.
    2) Immediately before 'saving' check that the database hasn't changed
    (either by reading what's there before updating, or by using a huge
    'where' clause that contains all unchanged fields)
    3) The Fort&eacute; "LockMgr" pattern, which uses a service object with notifier
    proxies to allow locking and updating notification between the clients.
    Option 3 is obviously the most robust method, but it requires a fair
    amount of coding and could also be a bottleneck for database reads and
    writes.
    But I have another option for which I was looking for opinions. What if
    we had a "Change Event manager" which broadcast an event every time
    a change is made to the database. Each business class would have its
    own event. If the event had the object's primary key as a parameter, then
    clients editing that particular object type could check to see if the object
    currently on screen is the one that changed. That way you could disable
    the 'save' until they had refreshed their on-screen data.
    It's not particularily elegant, but it's reasonably simple to implement. It
    also deals with changes sent across our WAN from other database
    servers.
    But this option is only worthwhile if you can replicate the "Change Event
    manager" SO and still register for an event on the client. Can clients
    register for SO events and receive an event generated by any of the SO's
    replicates? Or when you register for an SO's event do you register for
    only one instance of the SO?
    Thanks in advance for any answers.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email:
    [email protected]
    PO Box 764, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10
    years
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:
    http://pinehurst.sageit.com/listarchive/forte>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/forte>

  • Multiple start events in a process

    How does one add more than one start event to a process?
    "6.2.1.2 Using Multiple Start Events in a Process" of the modeling and implementation guide suggests this should be possible. I'd like to be able to create process instances using a none start event followed by a user task defined with the initiator pattern, so users can initiate the process. I also need to support creation of process instances via web service call. I should be able to accomplish this using a none start event followed by a receive task. However, I can't seem to get both in a single process. It only seems to allow a single start event.

    Sorry, I didn't realize that my component palette was being hidden - so I was missing a lot of activity/flow object types.
    Why is there only a small subset of flow objects displayed in the header of the process editor? (the one with the swimlanes)

  • RemoteApp receives multiple KeyUp events without any keys being pressed

    Hi All,
    I have a very simple winforms app that I am using to try and track down what is happening with keyboard events when using RemoteApp.
    Basically I have a form and a textbox that track the KeyDown, KeyPress and KeyUp events.
    As soon as I start my app via RemoteApp I receive multiple KeyUp events without even pressing a key.
    Does anyone know why RemoteApp would be sending these random KeyUp events.
    The code of my simple test app is as follows:
    Public Class Form1
    Dim lst As New List(Of String)
    Private Sub AddtoList(str As String)
    lst.Add(str)
    End Sub
    Private Sub TextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
    AddtoList("txt KeyDown" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub TextBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    AddtoList("txt KeyPress" & vbTab & "KeyChar is " & e.KeyChar)
    End Sub
    Private Sub TextBox1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
    AddtoList("txt KeyUp" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    AddtoList("Form Closing")
    IO.File.AppendAllLines(Application.StartupPath & "\SimpleKeyUp_v2.txt", lst)
    End Sub
    Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    AddtoList("Form KeyDown" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub Form1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
    AddtoList("Form KeyPress" & vbTab & "KeyChar is " & e.KeyChar)
    End Sub
    Private Sub Form1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
    AddtoList("Form KeyUp" & vbTab & "KeyCode is " & e.KeyCode)
    End Sub
    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
    AddtoList("Form Load")
    End Sub
    End Class
    Simply opening and closing the app via RemoteApp gives the following results:
    Form Load
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form KeyUp KeyCode is 16
    txt KeyUp KeyCode is 16
    Form KeyUp KeyCode is 16
    txt KeyUp KeyCode is 16
    Form KeyUp KeyCode is 17
    txt KeyUp KeyCode is 17
    Form KeyUp KeyCode is 17
    txt KeyUp KeyCode is 17
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form KeyUp KeyCode is 18
    txt KeyUp KeyCode is 18
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form KeyUp KeyCode is 18
    txt KeyUp KeyCode is 18
    Form KeyUp KeyCode is 9
    txt KeyUp KeyCode is 9
    Form Closing
    Cheers and Thanks in Advance!
    Dwayne

    Hi,
    It seems that your issue has been out of the scope of this forum.For coding issue,I suggest you ask in the
    MSDN forum to see whether anyone can help you out.
    Regards,
    Clarence
    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Mapping multiple objects to a same db table

    Can Kodo support mapping of multiple objects to a same table? For example,
    we have two objects PersAutoPolicy and InsuredOrPrinciple, and we want to
    map them to a same db table.

    Let me give a use case:
    class DO1 {
    long id;
    String data1;
    class DO2 {
    long id;
    String data2;
    Table table1 columns:
    id
    data1
    data2
    I want to map DO1 and DO2 to table1.
    Is this possible??
    Rick
    >>>>
    Martin van Dijken wrote:
    I'm fairly certain this works. We've got a two objects which both have a
    collection of another kind of object. I had the two collections mapped to
    the same table and that gave no problem at all. You'd have to wait for Kodo
    confirmation to be sure, but I'm 80% certain it can work.
    Martin
    "Rick Koo" <[email protected]> schreef in bericht
    news:b6rjcg$60d$[email protected]..
    Can Kodo support mapping of multiple objects to a same table? For example,
    we have two objects PersAutoPolicy and InsuredOrPrinciple, and we want to
    map them to a same db table.

  • Adding multiple objects

    Hi.
    I'm trying to add multiple objects to my universe, but i'm not sure how to do it. What i was thinking was to create a for loop and create the object within it.The z value refers to the z vector point.The code is below.I'm new to java 3D so if anyone could help me, that would be great.
    Thanks
    Sharon.      
    for (float z = 0f; z < 20f; z = z + 2){
              Cylinder cylinder = new Cylinder( 0.8f,10f );
              Color3f col = new Color3f(8f, .15f, .15f);
              ColoringAttributes ca = new ColoringAttributes (col,ColoringAttributes.NICEST);
              app.setColoringAttributes(ca);
              cylinder.setAppearance(app);
              Transform3D transform = new Transform3D();
              Vector3f vector = new Vector3f(0f, 0f, z);
              transform.setTranslation(vector);
              tg.setTransform(transform);
              tg.addChild( cylinder );
              bg.addChild( tg );
    }

    Hi.
    I have two programs, BGroup.java, which creates a rotating sphere and coloring attributes etc. and some1Canvas3D.java which creates a canvas and simple universe and panel with buttons and works on the BGroup.java program by adding it as a branchgraph to the simple universe "simpleU.addBranchGraph(new BGroup());". what i'd like to do is that if one of the buttons in some1Canvas3D.java is pressed then i want to decrease/increase the radius size of the sphere in BGroup.java. and see this within the canvas.
    I'm not sure how this will work.
    If anyone has any ideas how to do this, that'd be great.
    The code for the two programs is below . i'm quite new to Java3D so i hope it makes sense.
    Thanks for you help.
    Sharon
    /********BGroup.java****************
    import com.sun.j3d.utils.geometry.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import com.sun.j3d.utils.image.TextureLoader;
    public class BGroup extends BranchGroup
    public BGroup()
    /*create the transformGroup and set the capability to write.needed for rotation*/
    TransformGroup someGroup = new TransformGroup();
    someGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    //add the transform group to the branchgroup
    this.addChild(someGroup);
    //create the sphere and add it to the scene
    Sphere mysphere = new Sphere(0.5f);
    someGroup.addChild(mysphere);
    // Create a light that shines for 100m from the origin
    Color3f light1Color = new Color3f(7f, 2.6f, 4.1f);
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    Vector3f light1Direction = new Vector3f(9.0f, -7.0f, 5.0f);
    DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
    light1.setInfluencingBounds(bounds);
    someGroup.addChild(light1);
    Transform3D yAxis = new Transform3D();
         Alpha rotationAlpha = new Alpha(-1, 4000);
         RotationInterpolator rotator =
         new RotationInterpolator(rotationAlpha, someGroup, yAxis,
                        0.0f, (float) Math.PI*2.0f);
         rotator.setSchedulingBounds(bounds);
         someGroup.addChild(rotator);
    this.compile();
    *********************some1Canvas3D.java******************/
    import java.awt.*;
    import java.awt.GraphicsConfiguration;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import com.sun.j3d.utils.geometry.*;
    import javax.media.j3d.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.event.WindowAdapter;
    public class some1Canvas3D extends Applet {
    private Button go = new Button ("Forward");
    private Button go2 = new Button ("Left");
    private Button go3 = new Button ("Right");
    private Button go4 = new Button ("Back");
    private Button go5 = new Button ("Do it for me !!!");
    public void init()
    setLayout(new BorderLayout());
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D c1 = new Canvas3D(config);
    c1.setSize(256,256);
    add("Center", c1);
    SimpleUniverse simpleU = new SimpleUniverse(c1);
    simpleU.getViewingPlatform().setNominalViewingTransform();
    simpleU.addBranchGraph(new BGroup());
    Panel p = new Panel();
    p.add(go);
    p.add(go2);
    p.add(go3);
    p.add(go4);
    p.setBackground(Color.blue);
    p.setForeground(Color.red);
    add("North",p);
    Panel p2 = new Panel();
    p2.add(go5);
    p2.setBackground(Color.blue);
    p2.setForeground(Color.red);
    add("South",p2);
    public void start() {
    public void destroy() {
    public void run() {
    //Explains what happens when the Mouse is clicked on the Applet
    public void actionPerformed(ActionEvent e) {
         if (e.getSource()==go ) {
    /*when this button is pressed i want to be able to decrease the radius size of the sphere in BGroup.java*/
    public static void main(String []args)
    System.out.println("Program Started");
    new MainFrame(new some1Canvas3D(), 750,500);
    Thanks again.
    Sharon.

  • Custom scrolller - issue with multiple objects....

    Hi,
    I'm developing a very simple custom scroller as a proof of concept. The idea is to have a background image(content_mc), lay multiple objects(myContent[i]) on top of the image, and scroll them all as a cohesive unit. However, I can not scroll myContent[i] appropriately; each object has a unique position and when I try to scroll them, they all assume one position(in which everything overlaps), move to that position and then scroll(see the ### comment below). Does anyone know how to accomplish this?(or does any of this not make the slightest bit of sense?)
    Thx for any help,
    Chipleh
    var rect:Rectangle;var scrollerMinY:Number = scrollbar_mc.scroller_mc.y;
    var contentMaxY:Number = content_mc.y;
    var padding:Number = 40;
    scrollbar_mc.scroller_mc.buttonMode = true;
    scrollbar_mc.scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
    function dragIt(e:MouseEvent):void {
        rect = new Rectangle(4, 3, 0, 180);
        scrollbar_mc.scroller_mc.startDrag(false, rect);
        stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
        scrollbar_mc.scroller_mc.addEventListener(Event.ENTER_FRAME, scrollIt);
    function dropIt(e:MouseEvent):void {
        scrollbar_mc.scroller_mc.stopDrag();
        scrollbar_mc.scroller_mc.removeEventListener(Event.ENTER_FRAME, scrollIt);
    function scrollIt(e:Event):void
        var scrollerRange:Number = rect.height;
        var contentRange:Number = content_mc.height - mask_mc.height + padding;
        var percentage:Number = (scrollbar_mc.scroller_mc.y - scrollerMinY) / scrollerRange;
        var targetY:Number = contentMaxY - percentage * contentRange;
        content_mc.y = targetY;
        //###Herein lies the problem; I can not get multiple clips to align consistently like content_mc
        for(var i:int = 0;i<myContentArray.length;i++)
            var myContent:Object = MovieClip(root).getChildByName(myContentArray[i]);
            myContent.y = targetY - myContent.y;   

    Hiyas moccamaximum,
    Thx for the reply. Below are the screenshots, where the "align consistently" issue is apparent. When I instantiate the objects, the objects align per the "Before scrolling" screenshot. As soon as I start to scroll, the objects all align to one position(targetY)i.e.: "After scrolling" screenshot. I understand why that is happening, what i don't understand is how to maintain the layout of the objects while scrolling, per:
    for(var i:int = 0;i<myContentArray.length;i++)
            var myContent:Object = MovieClip(root).getChildByName(myContentArray[i]);
            myContent.y = targetY;   
    Before scrolling:
    During scrolling:

  • Apply multiple effects to multiple objects with single click box

    I would like to click on a click box and have one object appear and another object disappear. I guess what I'd like to do is apply effects to multiple objects with a single click box. Is that possible?
    Thank you.

    Welcome to our community
    Sure it can be done but you won't use effects to do it.
    When you insert an object in Captivate, you have an option to enable or disable Visibility. You also have an option to name the object. So you would give the object a meaningful name and clear the Visibility option to "hide" it until needed.
    Then you would create an Advanced Action that would hide some objects and show others.
    After that, you would assign the Advanced Action to a Click Box or a Button or some other event.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Problem with Multiple Objects

    Greetings,
    I've been experiencing a strange issue when I have multiple objects in a single document.
    From time to time, Pages deletes an image and then replaces it with a duplicate of another image in the document. The first image disappears, and I end up with two instances of the second image.
    The event seems to occur when I close and save. The problem is intermittent. However, I have been able to reproduce it while scrutinizing my design process to make sure that I'm not responsible for the error. I am very sure that this is a software issue.
    I usually work in Word Processing mode, with tiff images inserted as floating objects in a two column format.
    Has anyone else had this problem? Any ideas about how to fix it?
    Thanks!

    Christopher
    The immediate problem I can see is that several of your images have exactly the same name:
    image1.png
    How have you distinguished these on import and kept them apart in Finder?
    I think this is a case of User Error, where you have mixed up identically named files.
    To correct this, gather up all your images and rename them to, preferably, what they are.
    There is however a problem in OSX. It tenaciously hangs onto the original file's name to track it even after you move it.
    So open each file in turn in Preview, make a very slight edit like a small crop and rename it.
    I suggest using 2 naming conventions:
    Example: 01.03 xxxxx.png
    Where that is page 01 image 03 and xxxxxx = the psalm name.
    This way you can easily differentiate the images and place them in order in the file.
    Peter

  • Do multiple objects of class are handled as process or threads?

    Hi
    I was thinking that how multiple objects of same java class are handled on any app server?
    Will it be Thread based or Process based executtion.
    I think it will be Process based handling for different objects as they do not have anything to share(Pls correct if I am wrong)
    I have below basic questions for any concurrency handled by Java framework fo any app server
    1) If I have one non static method which has below two lines
    if(file.exists() == true) ///line 1
    file.delete(); //line 2
    So for one request one new object has been created which comes to execute method which has above 2 lines,
    If it executes first line and meanwhile ,App sever switches to second object execution which executes both line then now when First object's execution will be started ,it will be error some?
    Is it right understanding ,if yes then what should we do?
    2) If I have one static method for all objects share same space with same above definition thn what will happen?
    Thanks in advance
    Ab

    Peter__Lawrey wrote:
    abhishah4444 wrote:
    If answer is yes then what is the way to avoid these type of scenarios.It depends on what the situation is and what the concequence is.
    Sometimes it is simpler to compensate rather than avoid the scenario.
    e.g. it may be simpler to just ignore the error rather that try to enforce some locking.
    For example, what happens if you or another program deletes the file at the wrong moment and both threads fail. Can you synchronise the user as well? no.
    Can I use synchonised here for method definition which will make sure that only one thread completes both lines other will wait till time?Yes. but you could still get a failure.
    It depends and what you are trying to achieve.
    You need to look at a real example.I appreciate your help but I still have some things going in my mind which I am putting here, if you find inappropriate ,can you put in simple words for my understanding.
    When we say for two web rquest , app server will create 2 threads that means thoes two thread are specific to app sever which use same resource of app server ,but independent of java classes.So when each request creates one object each for java class, two threads are two independent processes for app server as we dont have any static variables or static functions for that java class.
    Why do you say
    Yes. but you could still get a failure.
    It depends and what you are trying to achieve.Will synchonised(this){
    if(f.exists())
    f.delete();
    will not take care of serialisation here,I think it will
    Edited by: abhishah4444 on Aug 12, 2008 2:53 PM

  • Move multiple objects with on click

    Hi there
    I am using Greensocks TweenMax to try and move multiple object across the screen with the onclick function. My code is not showing up errors and my Elements are at the front of the page but nothing happens when I click the element
    Here is my code, any help would be appricated
    // insert code for mouse click here
    TweenMax.to(sym.$("Geyser_Pic"), 1, {css:{right:"0px"}, ease:Expo.easeout});
    TweenMax.to(sym.$("Volcano"), 1, {css:{right:"150px"}, ease:Expo.easeout});
    TweenMax.to(sym.$("HotSpring"), 1, {css:{right:"100px"}, ease:Expo.easeout});

    Since you are saying you do not see any errors in the browser console,
    see if your click event is actually getting trigerred.Add a alert in the click event listener.
    If the event is getting trigerred,can you share or private message me your files .I will try to nail the issue.

  • What exactly is Object Event Repository?

    Hello,
    I´ve just read a marketing article about the new SAP Object Event Repository.      Precisely because it is a marking article the key-facts and functions are missing. It sounds like a reduced AII with extended database functions for Tag-tracking. Can somebody explain the benefit, technology and functions of the OER? What is the different between AII and OER?
    Thank you, Bastian

    Hi,
    SAP OER serves as a system of record for uniquely identified objects (like EPCs). So you are right in saying it like an extended database functions for tag tracking.
    But it will not reduce the AII functionalities. AII will still remain as the data capturing application (tag read) and the repository of these reads for the tags will be maintained in the OER. So these two are two different applications.
    OER allows for tracking any id or document for which information has been sent from AII. OER will also have the capability of generating reports (business intelligence) for these data reads maintained in its repository.
    SAP has recently unveiled is PTA (Product Tracking & Authentication) feature in OER. Read at http://www.sap.com/company/press/press.epx?PressID=7440
    Since this product has not come in the market yet, we need to wait till the time of its release for documents on the product. Then we might know the exact benefits/technology on OER.
    Thanks,
    Ashish

  • Error message "multiple objects found"

    Hi,
    I run into a new issue and durig role creation of design-time-roles. I get since a few days the message
    "test:testrole.hdbrole": multiple objects found
    my simplified role: (worked out before hundred times)
    test::test
    extends role test::testrole
    The role exists as design-time-object (one entry in "_SYS_REPO"."ACTIVE_OBJECT" and also only one entry in "SYS"."ROLES")
    Other roles can be granted as as usual - just a bunch of them make trouble.
    I dropped the roles (afterwards 0 entries in the mentioned tables) ... when activating testrole.hdbrole it says no object found - as expected. created the role again and the message appears again. Pretty weird.
    Did one of you had the same issue and solved it?
    Thanks for your answers in advance!
    Regards,
    Marcus
    P.S: Running HANA SP7 Rev 72 (DB+Studio+Client)

    Hi Mika
    Can you check your  : HKLM\SOFTWARE\Microsoft\Office\xxxx\Outlook\InstallRoot\Path
    For each key under HKLM\SOFTWARE\Microsoft\Office, apparently HKLM\SOFTWARE\Microsoft\Office\xxxx\Outlook\InstallRoot\Path has a "Outlook.exe" file at the location.
              If more than 1 file paths are found, then it appears that multiple versions of the outlook are installed.
    You might want to re install office if more thaqn one appears

Maybe you are looking for