KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > event > MonitorContendedEnteredEventImpl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal.event;
12
13 import java.io.DataInputStream JavaDoc;
14 import java.io.IOException JavaDoc;
15
16 import org.eclipse.jdi.internal.LocationImpl;
17 import org.eclipse.jdi.internal.MirrorImpl;
18 import org.eclipse.jdi.internal.ObjectReferenceImpl;
19 import org.eclipse.jdi.internal.ThreadReferenceImpl;
20 import org.eclipse.jdi.internal.VirtualMachineImpl;
21 import org.eclipse.jdi.internal.request.RequestID;
22
23 import com.sun.jdi.ObjectReference;
24 import com.sun.jdi.event.MonitorContendedEnteredEvent;
25
26 /**
27  * This class provides an implementation of MonitorContendedEnteredEvent according to Sun's
28  * 1.6 specs
29  * @since 3.3
30  */

31 public class MonitorContendedEnteredEventImpl extends LocatableEventImpl implements MonitorContendedEnteredEvent {
32
33     /** Jdwp Event Kind. */
34     public static final byte EVENT_KIND = EVENT_MONITOR_CONTENDED_ENTERED;
35     
36     /** the monitor information **/
37     private ObjectReference fMonitor;
38     
39     /** Constructor **/
40     private MonitorContendedEnteredEventImpl(VirtualMachineImpl vmImpl, RequestID requestID) {
41         super("MonitorContendedEntered", vmImpl, requestID); //$NON-NLS-1$
42
}
43
44     /**
45      * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
46      */

47     public static MonitorContendedEnteredEventImpl read(MirrorImpl target, RequestID requestID, DataInputStream JavaDoc dataInStream) throws IOException JavaDoc {
48         VirtualMachineImpl vmImpl = target.virtualMachineImpl();
49         MonitorContendedEnteredEventImpl event = new MonitorContendedEnteredEventImpl(vmImpl, requestID);
50         event.fThreadRef = ThreadReferenceImpl.read(target, dataInStream);
51         event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream);
52         event.fLocation = LocationImpl.read(target, dataInStream);
53         return event;
54     }
55     
56     /* (non-Javadoc)
57      * @see com.sun.jdi.event.MonitorContendedEnteredEvent#monitor()
58      */

59     public ObjectReference monitor() {
60         return fMonitor;
61     }
62 }
63
Popular Tags