killbill-memoizeit

Initial beatrix submodule

11/3/2011 10:14:38 PM

Details

beatrix/pom.xml 85(+85 -0)

diff --git a/beatrix/pom.xml b/beatrix/pom.xml
new file mode 100644
index 0000000..f13faf4
--- /dev/null
+++ b/beatrix/pom.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Copyright 2010-2011 Ning, Inc. ~ ~ Ning licenses this file to you 
+    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>com.ning.billing</groupId>
+        <artifactId>killbill</artifactId>
+        <version>0.0.6-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>killbill-beatrix</artifactId>
+    <name>killbill-beatrix</name>
+    <packaging>jar</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>com.ning.billing</groupId>
+            <artifactId>killbill-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.jolbox</groupId>
+            <artifactId>bonecp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.inject</groupId>
+            <artifactId>guice</artifactId>
+            <version>3.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.skife.config</groupId>
+            <artifactId>config-magic</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.ning.jdbi</groupId>
+            <artifactId>jdbi-metrics</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jdbi</groupId>
+            <artifactId>jdbi</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.mysql</groupId>
+            <artifactId>management</artifactId>
+            <version>5.0.11</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/beatrix/src/main/java/com/ning/billing/beatrix/config/IBusinessConfig.java b/beatrix/src/main/java/com/ning/billing/beatrix/config/IBusinessConfig.java
new file mode 100644
index 0000000..105bd46
--- /dev/null
+++ b/beatrix/src/main/java/com/ning/billing/beatrix/config/IBusinessConfig.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you 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 com.ning.billing.beatrix.config;
+
+public interface IBusinessConfig {
+
+}
diff --git a/beatrix/src/main/java/com/ning/billing/beatrix/config/IKillbillConfig.java b/beatrix/src/main/java/com/ning/billing/beatrix/config/IKillbillConfig.java
new file mode 100644
index 0000000..ef54f37
--- /dev/null
+++ b/beatrix/src/main/java/com/ning/billing/beatrix/config/IKillbillConfig.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you 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 com.ning.billing.beatrix.config;
+
+public interface IKillbillConfig {
+
+}
diff --git a/beatrix/src/main/java/com/ning/billing/beatrix/lifecycle/IService.java b/beatrix/src/main/java/com/ning/billing/beatrix/lifecycle/IService.java
new file mode 100644
index 0000000..b787113
--- /dev/null
+++ b/beatrix/src/main/java/com/ning/billing/beatrix/lifecycle/IService.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you 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 com.ning.billing.beatrix.lifecycle;
+
+import com.ning.billing.beatrix.config.IBusinessConfig;
+import com.ning.billing.beatrix.config.IKillbillConfig;
+
+public interface IService {
+
+    public static class ServiceException extends Exception  {
+
+        private static final long serialVersionUID = 176191207L;
+
+        public ServiceException() {
+            super();
+        }
+
+        public ServiceException(String msg, Throwable e) {
+            super(msg, e);
+        }
+
+        public ServiceException(String msg) {
+            super(msg);
+        }
+
+        public ServiceException(Throwable msg) {
+            super(msg);
+        }
+    }
+
+    /**
+     *
+     * @param businessConfig business configuration
+     * @param killbillConfig service detail configuration
+     * @throws ServiceException
+     *
+     * Initialize the service prior to start
+     */
+    public void initialize(IBusinessConfig businessConfig, IKillbillConfig killbillConfig)
+        throws ServiceException;
+
+    /**
+     *
+     * @throws ServiceException
+     *
+     * Start the given service
+     */
+    public void start()
+        throws ServiceException;
+
+    /**
+     * Stop the given service
+     *
+     * @throws ServiceException
+     */
+    public void stop()
+        throws ServiceException;
+
+}