01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdi.internal.event;
11:
12: import java.io.DataInputStream;
13: import java.io.IOException;
14:
15: import org.eclipse.jdi.internal.LocationImpl;
16: import org.eclipse.jdi.internal.MirrorImpl;
17: import org.eclipse.jdi.internal.ObjectReferenceImpl;
18: import org.eclipse.jdi.internal.ThreadReferenceImpl;
19: import org.eclipse.jdi.internal.VirtualMachineImpl;
20: import org.eclipse.jdi.internal.request.RequestID;
21:
22: import com.sun.jdi.ObjectReference;
23: import com.sun.jdi.event.MonitorContendedEnterEvent;
24:
25: /**
26: * This class provides an implementation of MonitorContendedEnterEvent according to Sun's
27: * 1.6 specs
28: * @since 3.3
29: */
30: public class MonitorContendedEnterEventImpl extends LocatableEventImpl
31: implements MonitorContendedEnterEvent {
32:
33: /** event kind iod **/
34: public static final byte EVENT_KIND = EVENT_MONITOR_CONTENDED_ENTER;
35:
36: /** the monitor information **/
37: private ObjectReference fMonitor;
38:
39: /** Constructor **/
40: private MonitorContendedEnterEventImpl(VirtualMachineImpl vmImpl,
41: RequestID requestID) {
42: super ("MonitorContendedEnter", vmImpl, requestID); //$NON-NLS-1$
43: }
44:
45: /**
46: * @return Creates, reads and returns new EventImpl, of which requestID has already been read.
47: */
48: public static MonitorContendedEnterEventImpl read(
49: MirrorImpl target, RequestID requestID,
50: DataInputStream dataInStream) throws IOException {
51: VirtualMachineImpl vmImpl = target.virtualMachineImpl();
52: MonitorContendedEnterEventImpl event = new MonitorContendedEnterEventImpl(
53: vmImpl, requestID);
54: event.fThreadRef = ThreadReferenceImpl.read(target,
55: dataInStream);
56: event.fMonitor = ObjectReferenceImpl.readObjectRefWithTag(
57: target, dataInStream);
58: event.fLocation = LocationImpl.read(target, dataInStream);
59: return event;
60: }
61:
62: /* (non-Javadoc)
63: * @see com.sun.jdi.event.MonitorContendedEnterEvent#monitor()
64: */
65: public ObjectReference monitor() {
66: return fMonitor;
67: }
68: }
|