Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
黄志磊
committed
Jan 12, 2016
1 parent
d48c76f
commit b720cf4
Showing
15 changed files
with
467 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
mpush-tools/src/main/java/com/shinemo/mpush/tools/spi/test/TestService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
package com.shinemo.mpush.tools.spi.test; | |||
|
|||
import com.shinemo.mpush.tools.spi.SPI; | |||
|
|||
|
|||
@SPI("test1") | |||
public interface TestService { | |||
|
|||
public String sayHi(String name); | |||
|
|||
} |
19 changes: 19 additions & 0 deletions
19
mpush-tools/src/main/java/com/shinemo/mpush/tools/spi/test/TestServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
package com.shinemo.mpush.tools.spi.test; | |||
|
|||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
|
|||
public class TestServiceImpl implements TestService { | |||
|
|||
private static final Logger log = LoggerFactory.getLogger(TestServiceImpl.class); | |||
|
|||
public TestServiceImpl() { | |||
log.warn("init"); | |||
} | |||
|
|||
@Override | |||
public String sayHi(String name) { | |||
return "TestServiceImpl1 hi,"+name; | |||
} | |||
|
|||
} |
20 changes: 20 additions & 0 deletions
20
mpush-tools/src/main/java/com/shinemo/mpush/tools/spi/test/TestServiceImpl2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
package com.shinemo.mpush.tools.spi.test; | |||
|
|||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
|
|||
|
|||
public class TestServiceImpl2 implements TestService { | |||
|
|||
private static final Logger log = LoggerFactory.getLogger(TestServiceImpl.class); | |||
|
|||
public TestServiceImpl2() { | |||
log.warn("init"); | |||
} | |||
|
|||
@Override | |||
public String sayHi(String name) { | |||
return "TestServiceImpl2 hi,"+name; | |||
} | |||
|
|||
} |
5 changes: 0 additions & 5 deletions
5
mpush-tools/src/main/java/com/shinemo/mpush/tools/zk/KickConnection.java
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
mpush-tools/src/main/java/com/shinemo/mpush/tools/zk/ZkRegister.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,37 @@ | |||
package com.shinemo.mpush.tools.zk; | |||
|
|||
import java.util.List; | |||
|
|||
import org.apache.curator.framework.CuratorFramework; | |||
|
|||
import com.shinemo.mpush.tools.spi.SPI; | |||
|
|||
|
|||
@SPI("zkRegister") | |||
public interface ZkRegister { | |||
|
|||
public void init(); | |||
|
|||
public void close(); | |||
|
|||
public void remove(String key); | |||
|
|||
public void registerEphemeralSequential(String key); | |||
|
|||
public void registerEphemeralSequential(String key, String value); | |||
|
|||
public void registerEphemeral(String key, String value); | |||
|
|||
public void update(String key, String value); | |||
|
|||
public void registerPersist(String key, String value); | |||
|
|||
public boolean isExisted(String key); | |||
|
|||
public List<String> getChildrenKeys(String key); | |||
|
|||
public String get(String key); | |||
|
|||
public CuratorFramework getClient(); | |||
|
|||
} |
Oops, something went wrong.