Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.loader; @@ -26,11 +26,11 @@ import java.util.zip.ZipInputStream; * @version $Rev$ $Date$ */ public class Zips { - public static void unzip(File zipFile, File destination) throws IOException { + public static void unzip(final File zipFile, final File destination) throws IOException { unzip(zipFile, destination, false); } - public static void unzip(File zipFile, File destination, boolean noparent) throws IOException { + public static void unzip(final File zipFile, final File destination, final boolean noparent) throws IOException { Files.dir(destination); Files.writable(destination); @@ -46,7 +46,7 @@ public class Zips { } } - public static void unzip(InputStream read, File destination, boolean noparent) throws IOException { + public static void unzip(final InputStream read, final File destination, final boolean noparent) throws IOException { try { // Open the ZIP file final ZipInputStream in = new ZipInputStream(read); @@ -55,7 +55,9 @@ public class Zips { while ((entry = in.getNextEntry()) != null) { String path = entry.getName(); - if (noparent) path = path.replaceFirst("^[^/]+/", ""); + if (noparent) { + path = path.replaceFirst("^[^/]+/", ""); + } final File file = new File(destination, path); if (entry.isDirectory()) {
Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.loader.event; @@ -27,7 +27,7 @@ public class ComponentAdded<T> { private final Class<T> type; private final T component; - public ComponentAdded(Class<T> type, T component) { + public ComponentAdded(final Class<T> type, final T component) { this.type = type; this.component = component; } Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.loader.event; @@ -27,7 +27,7 @@ public class ComponentRemoved<T> { private final Class<T> type; private final T component; - public ComponentRemoved(Class<T> type, T component) { + public ComponentRemoved(final Class<T> type, final T component) { this.type = type; this.component = component; } Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Event.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Event.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Event.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Event.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer; Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer; @@ -55,8 +55,10 @@ public class ObserverManager { private final Set<Observer> observers = new LinkedHashSet<Observer>(); private final Map<Class, Invocation> methods = new ConcurrentHashMap<Class, Invocation>(); - public boolean addObserver(Object observer) { - if (observer == null) throw new IllegalArgumentException("observer cannot be null"); + public boolean addObserver(final Object observer) { + if (observer == null) { + throw new IllegalArgumentException("observer cannot be null"); + } try { if (observers.add(new Observer(observer))) { @@ -66,7 +68,7 @@ public class ObserverManager { } else { return false; } - } catch (NotAnObserverException naoe) { + } catch (final NotAnObserverException naoe) { return false; } } @@ -83,12 +85,12 @@ public class ObserverManager { } else { return false; } - } catch (NotAnObserverException naoe) { + } catch (final NotAnObserverException naoe) { return false; } } - public <E> E fireEvent(E event) { + public <E> E fireEvent(final E event) { if (event == null) { throw new IllegalArgumentException("event cannot be null"); } @@ -100,7 +102,7 @@ public class ObserverManager { } } - private <E> E doFire(E event) { + private <E> E doFire(final E event) { final Class<?> type = event.getClass(); final Invocation invocation = getInvocation(type); @@ -110,7 +112,7 @@ public class ObserverManager { return event; } - private Invocation getInvocation(Class<?> type) { + private Invocation getInvocation(final Class<?> type) { { final Invocation invocation = methods.get(type); if (invocation != null) { @@ -319,11 +321,15 @@ public class ObserverManager { } private Invocation get(final Map<Class, Invocation> map, final Class eventType) { - if (eventType == null) return IGNORE; + if (eventType == null) { + return IGNORE; + } final Invocation method = map.get(eventType); - if (method != null) return method; + if (method != null) { + return method; + } return get(map, eventType.getSuperclass()); } @@ -368,7 +374,7 @@ public class ObserverManager { private static final Invocation IGNORE = new Invocation() { @Override - public void invoke(Object event) { + public void invoke(final Object event) { } @Override @@ -382,7 +388,7 @@ public class ObserverManager { private final Method method; private final Object observer; - public MethodInvocation(Method method, Object observer) { + public MethodInvocation(final Method method, final Object observer) { this.method = method; this.observer = observer; } @@ -391,8 +397,10 @@ public class ObserverManager { public void invoke(final Object event) { try { method.invoke(observer, event); - } catch (InvocationTargetException e) { - if (!seen.get().add(this)) return; + } catch (final InvocationTargetException e) { + if (!seen.get().add(this)) { + return; + } final Throwable t = e.getTargetException() == null ? e : e.getTargetException(); @@ -405,7 +413,7 @@ public class ObserverManager { } else { logger().log(Level.SEVERE, "error invoking " + observer, t); } - } catch (IllegalAccessException e) { + } catch (final IllegalAccessException e) { e.printStackTrace(); } } @@ -426,9 +434,9 @@ public class ObserverManager { return value; } - private class AfterInvocation extends MethodInvocation { + private final class AfterInvocation extends MethodInvocation { - private AfterInvocation(Method method, Object observer) { + private AfterInvocation(final Method method, final Object observer) { super(method, observer); } @@ -447,9 +455,9 @@ public class ObserverManager { } } - private class BeforeInvocation extends MethodInvocation { + private final class BeforeInvocation extends MethodInvocation { - private BeforeInvocation(Method method, Object observer) { + private BeforeInvocation(final Method method, final Object observer) { super(method, observer); } @@ -468,20 +476,20 @@ public class ObserverManager { } } - private static class BeforeAndAfterInvocationSet implements Invocation { + private static final class BeforeAndAfterInvocationSet implements Invocation { private final Invocation before; private final Invocation invoke; private final Invocation after; - private BeforeAndAfterInvocationSet(Invocation before, Invocation invoke, Invocation after) { + private BeforeAndAfterInvocationSet(final Invocation before, final Invocation invoke, final Invocation after) { this.before = before; this.invoke = invoke; this.after = after; } @Override - public void invoke(Object event) { + public void invoke(final Object event) { before.invoke(event); invoke.invoke(event); after.invoke(event); @@ -492,7 +500,7 @@ public class ObserverManager { private final List<Invocation> invocations = new LinkedList<Invocation>(); - public boolean add(Invocation invocation) { + public boolean add(final Invocation invocation) { return invocations.add(invocation); } @@ -501,15 +509,15 @@ public class ObserverManager { } @Override - public void invoke(Object event) { - for (Invocation invocation : invocations) { + public void invoke(final Object event) { + for (final Invocation invocation : invocations) { invocation.invoke(event); } } } public static class NotAnObserverException extends IllegalArgumentException { - public NotAnObserverException(String s) { + public NotAnObserverException(final String s) { super(s); } } Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Observes.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Observes.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Observes.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/Observes.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer; Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/AfterEvent.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/AfterEvent.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/AfterEvent.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/AfterEvent.java Thu May 22 22:27:50 2014 @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer.event; Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/BeforeEvent.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/BeforeEvent.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/BeforeEvent.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/BeforeEvent.java Thu May 22 22:27:50 2014 @@ -1,4 +1,4 @@ -/** +/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer.event; Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer.event; @@ -26,7 +26,7 @@ public class ObserverAdded { private final Object observer; - public ObserverAdded(Object observer) { + public ObserverAdded(final Object observer) { this.observer = observer; } Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer.event; @@ -34,7 +34,7 @@ public class ObserverFailed { private final Throwable throwable; - public ObserverFailed(Object observer, Method method, Object event, Throwable throwable) { + public ObserverFailed(final Object observer, final Method method, final Object event, final Throwable throwable) { this.observer = observer; this.event = event; this.method = method; Modified: tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java (original) +++ tomee/tomee/trunk/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java Thu May 22 22:27:50 2014 @@ -8,11 +8,11 @@ * * 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. + * 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 org.apache.openejb.observer.event; @@ -26,7 +26,7 @@ public class ObserverRemoved { private final Object observer; - public ObserverRemoved(Object observer) { + public ObserverRemoved(final Object observer) { this.observer = observer; } Modified: tomee/tomee/trunk/pom.xml URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/pom.xml?rev=1596978&r1=1596977&r2=1596978&view=diff ============================================================================== --- tomee/tomee/trunk/pom.xml (original) +++ tomee/tomee/trunk/pom.xml Thu May 22 22:27:50 2014 @@ -443,6 +443,7 @@ <id>style</id> <modules> <module>container/openejb-core</module> + <module>container/openejb-loader</module> </modules> <properties> <style.config.dir>${user.dir}/src/main/style</style.config.dir>
