Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move all library code to function-specific modules.
- Loading branch information
Showing
371 changed files
with
1,090 additions
and
482 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
66 changes: 66 additions & 0 deletions
66
logging/api/src/main/java/io/atomix/logging/LoggerFactory.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,66 @@ | |||
/* | |||
* Copyright 2017-present Open Networking Laboratory | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
package io.atomix.logging; | |||
|
|||
import java.util.Iterator; | |||
import java.util.ServiceLoader; | |||
|
|||
/** | |||
* Logger factory. | |||
*/ | |||
public final class LoggerFactory { | |||
private static volatile LoggingService service; | |||
|
|||
static { | |||
init(); | |||
} | |||
|
|||
/** | |||
* Initializes the logger factory. | |||
*/ | |||
private static void init() { | |||
Iterator<LoggingService> iterator = ServiceLoader.load(LoggingService.class).iterator(); | |||
if (!iterator.hasNext()) { | |||
throw new AssertionError("No logging service found"); | |||
} | |||
service = iterator.next(); | |||
} | |||
|
|||
/** | |||
* Returns a logger by name. | |||
* | |||
* @param name the logger name | |||
* @return the logger | |||
*/ | |||
public static Logger getLogger(String name) { | |||
return service.getLogger(name); | |||
} | |||
|
|||
/** | |||
* Returns a logger by class. | |||
* | |||
* @param clazz the class for which to return the logger | |||
* @return the logger for the given class | |||
*/ | |||
public static Logger getLogger(Class<?> clazz) { | |||
return service.getLogger(clazz); | |||
} | |||
|
|||
// No constructor. | |||
private LoggerFactory() { | |||
} | |||
|
|||
} |
39 changes: 39 additions & 0 deletions
39
logging/api/src/main/java/io/atomix/logging/LoggingService.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,39 @@ | |||
/* | |||
* Copyright 2017-present Open Networking Laboratory | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
package io.atomix.logging; | |||
|
|||
/** | |||
* Logging service. | |||
*/ | |||
public interface LoggingService { | |||
|
|||
/** | |||
* Returns a logger by name. | |||
* | |||
* @param name the logger name | |||
* @return the logger | |||
*/ | |||
Logger getLogger(String name); | |||
|
|||
/** | |||
* Returns a logger by class. | |||
* | |||
* @param clazz the class for which to return the logger | |||
* @return the logger for the given class | |||
*/ | |||
Logger getLogger(Class<?> clazz); | |||
|
|||
} |
File renamed without changes.
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
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
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
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
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
16 changes: 16 additions & 0 deletions
16
logging/slf4j/src/main/resources/META-INF/services/io.atomix.logging.LoggingService
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,16 @@ | |||
# | |||
# Copyright 2017-present Open Networking Laboratory | |||
# | |||
# Licensed under the Apache License, Version 2.0 (the "License"); | |||
# you may not use this file except in compliance with the License. | |||
# You may obtain a copy of the License at | |||
# | |||
# http://www.apache.org/licenses/LICENSE-2.0 | |||
# | |||
# Unless required by applicable law or agreed to in writing, software | |||
# distributed under the License is distributed on an "AS IS" BASIS, | |||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
# | |||
io.atomix.logging.slf4j.Slf4jLoggingService |
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,61 @@ | |||
<!-- | |||
~ Copyright 2017-present Open Networking Laboratory | |||
~ | |||
~ Licensed under the Apache License, Version 2.0 (the "License"); | |||
~ you may not use this file except in compliance with the License. | |||
~ You may obtain a copy of the License at | |||
~ | |||
~ http://www.apache.org/licenses/LICENSE-2.0 | |||
~ | |||
~ Unless required by applicable law or agreed to in writing, software | |||
~ distributed under the License is distributed on an "AS IS" BASIS, | |||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
~ See the License for the specific language governing permissions and | |||
~ limitations under the License. | |||
--> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
|
|||
<parent> | |||
<groupId>io.atomix</groupId> | |||
<artifactId>atomix-messaging-parent</artifactId> | |||
<version>2.0.0-SNAPSHOT</version> | |||
</parent> | |||
|
|||
<packaging>bundle</packaging> | |||
<artifactId>atomix-messaging</artifactId> | |||
<name>Atomix Messaging</name> | |||
|
|||
<dependencies> | |||
<dependency> | |||
<groupId>io.atomix</groupId> | |||
<artifactId>atomix-utils</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>io.atomix</groupId> | |||
<artifactId>atomix-cluster</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
</dependencies> | |||
|
|||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.apache.felix</groupId> | |||
<artifactId>maven-bundle-plugin</artifactId> | |||
<extensions>true</extensions> | |||
<configuration> | |||
<instructions> | |||
<Export-Package> | |||
io.atomix.* | |||
</Export-Package> | |||
<Import-Package> | |||
!sun.nio.ch,!sun.misc,* | |||
</Import-Package> | |||
</instructions> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
File renamed without changes.
Oops, something went wrong.