Skip to content

Commit

Permalink
Merge branch 'master' of code.dianpingoa.com:arch/cat
Browse files Browse the repository at this point in the history
  • Loading branch information
jialinsun committed Mar 10, 2015
2 parents aae2dbc + a956222 commit 2d1e6ec
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cat-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-agent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cat-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>broker-service</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cat-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-client</artifactId>
Expand Down
22 changes: 9 additions & 13 deletions cat-client/src/main/java/com/dianping/cat/Cat.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@
public class Cat {
private static Cat s_instance = new Cat();

private static volatile boolean s_init = false;

private MessageProducer m_producer;

private MessageManager m_manager;

private PlexusContainer m_container;

private static void checkAndInitialize() {
if (s_instance.m_container == null) {
if (!s_init) {
synchronized (s_instance) {
if (s_instance.m_container == null) {
if (!s_init) {
initialize(new File(getCatHome(), "client.xml"));
s_init = true;
log("WARN", "Cat is lazy initialized!");
}
}
Expand Down Expand Up @@ -150,7 +153,7 @@ public static void logHeartbeat(String type, String name, String status, String
}

public static void logMetric(String name, Object... keyValues) {
//TO REMOVE ME
// TO REMOVE ME
}

/**
Expand Down Expand Up @@ -269,21 +272,14 @@ private Cat() {
}

void setContainer(PlexusContainer container) {
m_container = container;

try {
m_container = container;
m_manager = container.lookup(MessageManager.class);
} catch (ComponentLookupException e) {
throw new RuntimeException("Unable to get instance of MessageManager, "
+ "please make sure the environment was setup correctly!", e);
}

try {
m_producer = container.lookup(MessageProducer.class);
} catch (ComponentLookupException e) {
throw new RuntimeException("Unable to get instance of MessageProducer, "
throw new RuntimeException("Unable to get instance of MessageManager, "
+ "please make sure the environment was setup correctly!", e);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected void decodeHeader(Context ctx, MessageTree tree) {
throw new RuntimeException(String.format("Unrecognized id(%s) for plain text message codec!", id));
}
}

protected Message decodeLine(Context ctx, DefaultTransaction parent, Stack<DefaultTransaction> stack,
MessageTree tree) {
BufferHelper helper = m_bufferHelper;
Expand Down
2 changes: 1 addition & 1 deletion cat-consumer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-consumer</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cat-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cat-hadoop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-hadoop</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cat-home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-home</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cat-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-maven-plugin</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
<name>parent</name>
<description>Central Application Tracking</description>
<packaging>pom</packaging>
Expand Down Expand Up @@ -174,7 +174,7 @@ org.eclipse.jdt.core.compiler.compliance=1.6
<plugin>
<groupId>com.dianping.cat</groupId>
<artifactId>cat-maven-plugin</artifactId>
<version>1.2.9</version>
<version>1.3.0</version>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 2d1e6ec

Please sign in to comment.