KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > appevent > NonPortableEventContextFactory


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.appevent;
5
6 import com.tc.net.protocol.tcm.ChannelIDProvider;
7
8 public class NonPortableEventContextFactory {
9
10   private final ChannelIDProvider provider;
11
12   public NonPortableEventContextFactory(ChannelIDProvider provider) {
13     this.provider = provider;
14   }
15
16   private String JavaDoc getJVMId() {
17     return "VM(" + provider.getChannelID().toLong() + ")";
18   }
19
20   public NonPortableEventContext createNonPortableEventContext(String JavaDoc targetClassName) {
21     return new NonPortableEventContext(targetClassName, Thread.currentThread().getName(), getJVMId());
22   }
23
24   public NonPortableFieldSetContext createNonPortableFieldSetContext(String JavaDoc targetClassName, String JavaDoc fieldName,
25                                                                      boolean isRoot) {
26     return new NonPortableFieldSetContext(targetClassName, Thread.currentThread().getName(), getJVMId(), fieldName,
27                                           isRoot);
28   }
29
30   public NonPortableLogicalInvokeContext createNonPortableLogicalInvokeContext(String JavaDoc targetClassName, String JavaDoc methodName) {
31     return new NonPortableLogicalInvokeContext(targetClassName, Thread.currentThread().getName(), getJVMId(),
32                                                methodName);
33   }
34
35 }
36
Popular Tags