Apply Apache Felix code styles
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1027838 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/coordinator/src/main/java/org/apache/felix/coordination/impl/Activator.java b/coordinator/src/main/java/org/apache/felix/coordination/impl/Activator.java
index 004b1eb..9bc11c9 100644
--- a/coordinator/src/main/java/org/apache/felix/coordination/impl/Activator.java
+++ b/coordinator/src/main/java/org/apache/felix/coordination/impl/Activator.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * regarding copyright ownership. The ASF 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -36,7 +36,8 @@
import org.osgi.util.tracker.ServiceTracker;
@SuppressWarnings("deprecation")
-public class Activator implements BundleActivator {
+public class Activator implements BundleActivator
+{
private CoordinationMgr mgr;
@@ -44,32 +45,37 @@
private ServiceRegistration coordinatorService;
- public void start(BundleContext context) {
+ public void start(BundleContext context)
+ {
mgr = new CoordinationMgr();
- try {
+ try
+ {
mbeanServerTracker = new MBeanServerTracker(context, mgr);
mbeanServerTracker.open();
- } catch (MalformedObjectNameException e) {
+ }
+ catch (MalformedObjectNameException e)
+ {
// TODO log
}
ServiceFactory factory = new CoordinatorFactory(mgr);
Hashtable<String, String> props = new Hashtable<String, String>();
- props.put(Constants.SERVICE_DESCRIPTION,
- "Coordinator Service Implementation");
+ props.put(Constants.SERVICE_DESCRIPTION, "Coordinator Service Implementation");
props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
- coordinatorService = context.registerService(
- Coordinator.class.getName(), factory, props);
+ coordinatorService = context.registerService(Coordinator.class.getName(), factory, props);
}
- public void stop(BundleContext context) {
- if (coordinatorService != null) {
+ public void stop(BundleContext context)
+ {
+ if (coordinatorService != null)
+ {
coordinatorService.unregister();
coordinatorService = null;
}
- if (mbeanServerTracker != null) {
+ if (mbeanServerTracker != null)
+ {
mbeanServerTracker.close();
mbeanServerTracker = null;
}
@@ -77,45 +83,53 @@
mgr.cleanUp();
}
- static final class CoordinatorFactory implements ServiceFactory {
+ static final class CoordinatorFactory implements ServiceFactory
+ {
private final CoordinationMgr mgr;
- CoordinatorFactory(final CoordinationMgr mgr) {
+ CoordinatorFactory(final CoordinationMgr mgr)
+ {
this.mgr = mgr;
}
- public Object getService(Bundle bundle, ServiceRegistration registration) {
+ public Object getService(Bundle bundle, ServiceRegistration registration)
+ {
return new CoordinatorImpl(bundle, mgr);
}
- public void ungetService(Bundle bundle,
- ServiceRegistration registration, Object service) {
+ public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
+ {
((CoordinatorImpl) service).dispose();
}
}
- static final class MBeanServerTracker extends ServiceTracker {
+ static final class MBeanServerTracker extends ServiceTracker
+ {
private final CoordinationMgr mgr;
private final ObjectName objectName;
- MBeanServerTracker(final BundleContext context,
- final CoordinationMgr mgr) throws MalformedObjectNameException {
+ MBeanServerTracker(final BundleContext context, final CoordinationMgr mgr) throws MalformedObjectNameException
+ {
super(context, MBeanServer.class.getName(), null);
this.mgr = mgr;
this.objectName = new ObjectName(CoordinatorMBean.OBJECTNAME);
}
@Override
- public Object addingService(ServiceReference reference) {
+ public Object addingService(ServiceReference reference)
+ {
MBeanServer server = (MBeanServer) super.addingService(reference);
- try {
+ try
+ {
server.registerMBean(mgr, objectName);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
// TODO: log
}
@@ -123,10 +137,14 @@
}
@Override
- public void removedService(ServiceReference reference, Object service) {
- try {
+ public void removedService(ServiceReference reference, Object service)
+ {
+ try
+ {
((MBeanServer) service).unregisterMBean(objectName);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
// TODO: log
}
diff --git a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java
index 8db042f..e02b939 100644
--- a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java
+++ b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * regarding copyright ownership. The ASF 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -29,7 +29,8 @@
import org.apache.felix.service.coordination.Participant;
@SuppressWarnings("deprecation")
-public class CoordinationImpl implements Coordination {
+public class CoordinationImpl implements Coordination
+{
/** Active */
private static final int ACTIVE = 1;
@@ -72,8 +73,8 @@
private Thread initiatorThread;
- public CoordinationImpl(final CoordinatorImpl owner, final long id,
- final String name, final long defaultTimeOutInMs) {
+ public CoordinationImpl(final CoordinatorImpl owner, final long id, final String name, final long defaultTimeOutInMs)
+ {
this.owner = owner;
this.id = id;
this.name = name;
@@ -87,15 +88,18 @@
scheduleTimeout(defaultTimeOutInMs);
}
- public String getName() {
+ public String getName()
+ {
return name;
}
- long getId() {
+ long getId()
+ {
return this.id;
}
- void mustFail(final Throwable reason) {
+ void mustFail(final Throwable reason)
+ {
this.mustFail = FAILED;
this.failReason = reason;
}
@@ -106,7 +110,8 @@
* <p>
* This method is inteded to only be called from the scheduled timer task.
*/
- void timeout() {
+ void timeout()
+ {
// If a timeout happens, the coordination thread is set to always fail
this.mustFail = TIMEOUT;
@@ -114,13 +119,17 @@
CoordinationImpl.this.fail(null);
}
- long getTimeOut() {
+ long getTimeOut()
+ {
return this.timeOutInMs;
}
- public int end() throws IllegalStateException {
- if (startTermination()) {
- if (mustFail != 0) {
+ public int end() throws IllegalStateException
+ {
+ if (startTermination())
+ {
+ if (mustFail != 0)
+ {
failInternal();
return mustFail;
}
@@ -131,8 +140,10 @@
throw new IllegalStateException();
}
- public boolean fail(Throwable reason) {
- if (startTermination()) {
+ public boolean fail(Throwable reason)
+ {
+ if (startTermination())
+ {
this.failReason = reason;
failInternal();
return true;
@@ -140,12 +151,17 @@
return false;
}
- public boolean terminate() {
- if (state == ACTIVE) {
- try {
+ public boolean terminate()
+ {
+ if (state == ACTIVE)
+ {
+ try
+ {
end();
return true;
- } catch (IllegalStateException ise) {
+ }
+ catch (IllegalStateException ise)
+ {
// another thread might have started the termination just
// after the current thread checked the state but before the
// end() method called on this thread was able to change the
@@ -161,7 +177,8 @@
* The return value of <code>false</code> may be a transient situation if
* the coordination is in the process of terminating due to a failure.
*/
- public boolean isFailed() {
+ public boolean isFailed()
+ {
return state == FAILED;
}
@@ -171,12 +188,15 @@
* The return value of <code>false</code> may be a transient situation if
* the coordination is in the process of terminating.
*/
- public boolean isTerminated() {
+ public boolean isTerminated()
+ {
return state == TERMINATED;
}
- public void addTimeout(long timeOutInMs) {
- if (this.timeOutInMs > 0) {
+ public void addTimeout(long timeOutInMs)
+ {
+ if (this.timeOutInMs > 0)
+ {
// already set, ignore
}
@@ -192,12 +212,13 @@
* another coordination.
* <p>
* Participants can only be added to a coordination if it is active.
- *
+ *
* @throws org.apache.felix.service.coordination.CoordinationException if
* the participant cannot currently participate in this
* coordination
*/
- public boolean participate(Participant p) {
+ public boolean participate(Participant p)
+ {
// ensure participant only pariticipates on a single coordination
// this blocks until the participant can participate or until
@@ -206,9 +227,12 @@
// synchronize access to the state to prevent it from being changed
// while adding the participant
- synchronized (this) {
- if (state == ACTIVE) {
- if (!participants.contains(p)) {
+ synchronized (this)
+ {
+ if (state == ACTIVE)
+ {
+ if (!participants.contains(p))
+ {
participants.add(p);
}
return true;
@@ -217,11 +241,14 @@
}
}
- public Collection<Participant> getParticipants() {
+ public Collection<Participant> getParticipants()
+ {
// synchronize access to the state to prevent it from being changed
// while we create a copy of the participant list
- synchronized (this) {
- if (state == ACTIVE) {
+ synchronized (this)
+ {
+ if (state == ACTIVE)
+ {
return new ArrayList<Participant>(participants);
}
}
@@ -229,7 +256,8 @@
return Collections.<Participant> emptyList();
}
- public Map<Class<?>, ?> getVariables() {
+ public Map<Class<?>, ?> getVariables()
+ {
return variables;
}
@@ -239,14 +267,16 @@
* {@value State#TERMINATING}, unregistering from the
* {@link CoordinationMgr} and ensuring there is no timeout task active any
* longer to timeout this coordination.
- *
+ *
* @return <code>true</code> If the coordination was active and termination
* can continue. If <code>false</code> is returned, the coordination
* must be considered terminated (or terminating) in the current
* thread and no further termination processing must take place.
*/
- private synchronized boolean startTermination() {
- if (state == ACTIVE) {
+ private synchronized boolean startTermination()
+ {
+ if (state == ACTIVE)
+ {
state = TERMINATING;
owner.unregister(this);
scheduleTimeout(-1);
@@ -263,16 +293,21 @@
* This method must only be called after the {@link #state} field has been
* set to {@link State#TERMINATING} and only be the method successfully
* setting this state.
- *
+ *
* @return OK or PARTIALLY_ENDED depending on whether all participants
* succeeded or some of them failed ending the coordination.
*/
- private int endInternal() {
+ private int endInternal()
+ {
int reason = OK;
- for (Participant part : participants) {
- try {
+ for (Participant part : participants)
+ {
+ try
+ {
part.ended(this);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
// TODO: log
reason = PARTIALLY_ENDED;
}
@@ -291,12 +326,17 @@
* set to {@link State#TERMINATING} and only be the method successfully
* setting this state.
*/
- private void failInternal() {
+ private void failInternal()
+ {
// consider failure reason (if not null)
- for (Participant part : participants) {
- try {
+ for (Participant part : participants)
+ {
+ try
+ {
part.failed(this);
- } catch (Exception e) {
+ }
+ catch (Exception e)
+ {
// TODO: log
}
@@ -310,19 +350,24 @@
* Helper method for timeout scheduling. If a timer is currently scheduled
* it is canceled. If the new timeout value is a positive value a new timer
* is scheduled to fire of so many milliseconds from now.
- *
+ *
* @param timeout The new timeout value
*/
- private void scheduleTimeout(final long timeout) {
- if (timeoutTask != null) {
+ private void scheduleTimeout(final long timeout)
+ {
+ if (timeoutTask != null)
+ {
owner.schedule(timeoutTask, -1);
timeoutTask = null;
}
- if (timeout > 0) {
- timeoutTask = new TimerTask() {
+ if (timeout > 0)
+ {
+ timeoutTask = new TimerTask()
+ {
@Override
- public void run() {
+ public void run()
+ {
CoordinationImpl.this.timeout();
}
};
diff --git a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationMgr.java b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationMgr.java
index 011bf97..2564f98 100644
--- a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationMgr.java
+++ b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationMgr.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * regarding copyright ownership. The ASF 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -53,7 +53,8 @@
* </ul>
*/
@SuppressWarnings("deprecation")
-public class CoordinationMgr implements CoordinatorMBean {
+public class CoordinationMgr implements CoordinatorMBean
+{
private ThreadLocal<Stack<Coordination>> threadStacks;
@@ -75,26 +76,29 @@
/**
* Wait at most 60 seconds for participant to be eligible for participation
* in a coordination.
- *
+ *
* @see #singularizeParticipant(Participant, CoordinationImpl)
*/
private long participationTimeOut = 60 * 1000L;
- CoordinationMgr() {
+ CoordinationMgr()
+ {
ctr = new AtomicLong(-1);
coordinations = new HashMap<Long, CoordinationImpl>();
participants = new HashMap<Participant, CoordinationImpl>();
coordinationTimer = new Timer("Coordination Timer", true);
}
- void cleanUp() {
+ void cleanUp()
+ {
// terminate coordination timeout timer
coordinationTimer.purge();
coordinationTimer.cancel();
// terminate all active coordinations
final Exception reason = new Exception();
- for (Coordination c : coordinations.values()) {
+ for (Coordination c : coordinations.values())
+ {
c.fail(reason);
}
coordinations.clear();
@@ -103,35 +107,45 @@
participants.clear();
}
- void configure(final long coordinationTimeout,
- final long participationTimeout) {
+ void configure(final long coordinationTimeout, final long participationTimeout)
+ {
this.defaultTimeOut = coordinationTimeout;
this.participationTimeOut = participationTimeout;
}
- void schedule(final TimerTask task, final long delay) {
- if (delay < 0) {
+ void schedule(final TimerTask task, final long delay)
+ {
+ if (delay < 0)
+ {
task.cancel();
- } else {
+ }
+ else
+ {
coordinationTimer.schedule(task, delay);
}
}
- void lockParticipant(final Participant p, final CoordinationImpl c) {
- synchronized (participants) {
+ void lockParticipant(final Participant p, final CoordinationImpl c)
+ {
+ synchronized (participants)
+ {
// wait for participant to be released
long cutOff = System.currentTimeMillis() + participationTimeOut;
- while (participants.containsKey(p)) {
- try {
+ while (participants.containsKey(p))
+ {
+ try
+ {
participants.wait(participationTimeOut / 500);
- } catch (InterruptedException ie) {
+ }
+ catch (InterruptedException ie)
+ {
// don't worry, just keep on waiting
}
// timeout waiting for participation
- if (System.currentTimeMillis() > cutOff) {
- throw new CoordinationException(
- "Timed out waiting to join coordinaton", c.getName(),
+ if (System.currentTimeMillis() > cutOff)
+ {
+ throw new CoordinationException("Timed out waiting to join coordinaton", c.getName(),
CoordinationException.TIMEOUT);
}
}
@@ -141,8 +155,10 @@
}
}
- void releaseParticipant(final Participant p) {
- synchronized (participants) {
+ void releaseParticipant(final Participant p)
+ {
+ synchronized (participants)
+ {
participants.remove(p);
participants.notifyAll();
}
@@ -150,51 +166,61 @@
// ---------- Coordinator back end implementation
- Coordination create(final CoordinatorImpl owner, final String name) {
+ Coordination create(final CoordinatorImpl owner, final String name)
+ {
long id = ctr.incrementAndGet();
- CoordinationImpl c = new CoordinationImpl(owner, id, name,
- defaultTimeOut);
+ CoordinationImpl c = new CoordinationImpl(owner, id, name, defaultTimeOut);
coordinations.put(id, c);
return c;
}
- void unregister(final CoordinationImpl c) {
+ void unregister(final CoordinationImpl c)
+ {
coordinations.remove(c.getId());
Stack<Coordination> stack = threadStacks.get();
- if (stack != null) {
+ if (stack != null)
+ {
stack.remove(c);
}
}
- Coordination push(Coordination c) {
+ Coordination push(Coordination c)
+ {
Stack<Coordination> stack = threadStacks.get();
- if (stack == null) {
+ if (stack == null)
+ {
stack = new Stack<Coordination>();
threadStacks.set(stack);
}
return stack.push(c);
}
- Coordination pop() {
+ Coordination pop()
+ {
Stack<Coordination> stack = threadStacks.get();
- if (stack != null && !stack.isEmpty()) {
+ if (stack != null && !stack.isEmpty())
+ {
return stack.pop();
}
return null;
}
- Coordination getCurrentCoordination() {
+ Coordination getCurrentCoordination()
+ {
Stack<Coordination> stack = threadStacks.get();
- if (stack != null && !stack.isEmpty()) {
+ if (stack != null && !stack.isEmpty())
+ {
return stack.peek();
}
return null;
}
- Collection<Coordination> getCoordinations() {
+ Collection<Coordination> getCoordinations()
+ {
ArrayList<Coordination> result = new ArrayList<Coordination>();
Stack<Coordination> stack = threadStacks.get();
- if (stack != null) {
+ if (stack != null)
+ {
result.addAll(stack);
}
return result;
@@ -202,14 +228,20 @@
// ---------- CoordinatorMBean interface
- public TabularData listCoordinations(String regexFilter) {
+ public TabularData listCoordinations(String regexFilter)
+ {
Pattern p = Pattern.compile(regexFilter);
TabularData td = new TabularDataSupport(COORDINATIONS_TYPE);
- for (CoordinationImpl c : coordinations.values()) {
- if (p.matcher(c.getName()).matches()) {
- try {
+ for (CoordinationImpl c : coordinations.values())
+ {
+ if (p.matcher(c.getName()).matches())
+ {
+ try
+ {
td.put(fromCoordination(c));
- } catch (OpenDataException e) {
+ }
+ catch (OpenDataException e)
+ {
// TODO: log
}
}
@@ -217,37 +249,46 @@
return td;
}
- public CompositeData getCoordination(long id) throws IOException {
+ public CompositeData getCoordination(long id) throws IOException
+ {
CoordinationImpl c = coordinations.get(id);
- if (c != null) {
- try {
+ if (c != null)
+ {
+ try
+ {
return fromCoordination(c);
- } catch (OpenDataException e) {
+ }
+ catch (OpenDataException e)
+ {
throw new IOException(e.toString());
}
}
throw new IOException("No such Coordination " + id);
}
- public boolean fail(long id, String reason) {
+ public boolean fail(long id, String reason)
+ {
Coordination c = coordinations.get(id);
- if (c != null) {
+ if (c != null)
+ {
return c.fail(new Exception(reason));
}
return false;
}
- public void addTimeout(long id, long timeout) {
+ public void addTimeout(long id, long timeout)
+ {
Coordination c = coordinations.get(id);
- if (c != null) {
+ if (c != null)
+ {
c.addTimeout(timeout);
}
}
- private CompositeData fromCoordination(final CoordinationImpl c)
- throws OpenDataException {
- return new CompositeDataSupport(COORDINATION_TYPE, new String[] { ID,
- NAME, TIMEOUT }, new Object[] { c.getId(), c.getName(),
- c.getTimeOut() });
+ private CompositeData fromCoordination(final CoordinationImpl c) throws OpenDataException
+ {
+ return new CompositeDataSupport(COORDINATION_TYPE, new String[]
+ { ID, NAME, TIMEOUT }, new Object[]
+ { c.getId(), c.getName(), c.getTimeOut() });
}
}
diff --git a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinatorImpl.java b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinatorImpl.java
index d966c1d..e28fac2 100644
--- a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinatorImpl.java
+++ b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinatorImpl.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * regarding copyright ownership. The ASF 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -29,7 +29,8 @@
import org.osgi.framework.Bundle;
@SuppressWarnings("deprecation")
-public class CoordinatorImpl implements Coordinator {
+public class CoordinatorImpl implements Coordinator
+{
private final Bundle owner;
@@ -37,7 +38,8 @@
private final HashSet<Coordination> coordinations;
- CoordinatorImpl(final Bundle owner, final CoordinationMgr mgr) {
+ CoordinatorImpl(final Bundle owner, final CoordinationMgr mgr)
+ {
this.owner = owner;
this.mgr = mgr;
this.coordinations = new HashSet<Coordination>();
@@ -49,99 +51,121 @@
* <p>
* Called by the Coordinator ServiceFactory when this CoordinatorImpl
* instance is not used any longer by the owner bundle.
- *
+ *
* @see FELIX-2671/OSGi Bug 104
*/
- void dispose() {
+ void dispose()
+ {
final Coordination[] active;
- synchronized (coordinations) {
- if (coordinations.isEmpty()) {
+ synchronized (coordinations)
+ {
+ if (coordinations.isEmpty())
+ {
active = null;
- } else {
+ }
+ else
+ {
active = coordinations.toArray(new CoordinationImpl[coordinations.size()]);
coordinations.clear();
}
}
- if (active != null) {
+ if (active != null)
+ {
Throwable reason = new Exception("Coordinator service released");
- for (int i = 0; i < active.length; i++) {
+ for (int i = 0; i < active.length; i++)
+ {
active[i].fail(reason);
}
}
}
- public Coordination create(String name) {
+ public Coordination create(String name)
+ {
// TODO: check permission
Coordination c = mgr.create(this, name);
- synchronized (coordinations) {
+ synchronized (coordinations)
+ {
coordinations.add(c);
}
return c;
}
- public Coordination begin(String name) {
+ public Coordination begin(String name)
+ {
// TODO: check permission
return push(create(name));
}
- public Coordination push(Coordination c) {
+ public Coordination push(Coordination c)
+ {
// TODO: check permission
return mgr.push(c);
}
- public Coordination pop() {
+ public Coordination pop()
+ {
// TODO: check permission
return mgr.pop();
}
- public Coordination getCurrentCoordination() {
+ public Coordination getCurrentCoordination()
+ {
// TODO: check permission
return mgr.getCurrentCoordination();
}
- public boolean alwaysFail(Throwable reason) {
+ public boolean alwaysFail(Throwable reason)
+ {
// TODO: check permission
CoordinationImpl current = (CoordinationImpl) getCurrentCoordination();
- if (current != null) {
+ if (current != null)
+ {
current.mustFail(reason);
return true;
}
return false;
}
- public Collection<Coordination> getCoordinations() {
+ public Collection<Coordination> getCoordinations()
+ {
// TODO: check permission
return mgr.getCoordinations();
}
- public boolean participate(Participant participant)
- throws CoordinationException {
+ public boolean participate(Participant participant) throws CoordinationException
+ {
// TODO: check permission
Coordination current = getCurrentCoordination();
- if (current != null) {
+ if (current != null)
+ {
current.participate(participant);
return true;
}
return false;
}
- void unregister(final CoordinationImpl c) {
+ void unregister(final CoordinationImpl c)
+ {
mgr.unregister(c);
- synchronized (coordinations) {
+ synchronized (coordinations)
+ {
coordinations.remove(c);
}
}
- void schedule(final TimerTask task, final long delay) {
+ void schedule(final TimerTask task, final long delay)
+ {
mgr.schedule(task, delay);
}
- void lockParticipant(final Participant p, final CoordinationImpl c) {
+ void lockParticipant(final Participant p, final CoordinationImpl c)
+ {
mgr.lockParticipant(p, c);
}
- void releaseParticipant(final Participant p) {
+ void releaseParticipant(final Participant p)
+ {
mgr.releaseParticipant(p);
}
}
diff --git a/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/CoordinatorMBean.java b/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/CoordinatorMBean.java
index 4b4a616..8ce307c 100644
--- a/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/CoordinatorMBean.java
+++ b/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/CoordinatorMBean.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -27,12 +27,13 @@
/**
* This MBean provides the management interface to the OSGi Coordinator Service
- *
+ *
* @ThreadSafe
* @Provisional
*/
@Deprecated
-public interface CoordinatorMBean {
+public interface CoordinatorMBean
+{
/**
* User Admin MBean object name.
@@ -48,8 +49,7 @@
* The item for the user name for an authorization object. The key is NAME
* and the type is SimpleType.STRING.
*/
- public static final org.osgi.jmx.Item NAME_ITEM = new Item(NAME, null,
- SimpleType.STRING, (String[]) null);
+ public static final org.osgi.jmx.Item NAME_ITEM = new Item(NAME, null, SimpleType.STRING, (String[]) null);
/**
* The key ID, used in ID_ITEM.
@@ -62,8 +62,7 @@
* unique Coordination (which should no be pinned in memory because of
* this).
*/
- public static final org.osgi.jmx.Item ID_ITEM = new Item(ID, null,
- SimpleType.LONG, (String[]) null);
+ public static final org.osgi.jmx.Item ID_ITEM = new Item(ID, null, SimpleType.LONG, (String[]) null);
/**
* The key TIMEOUT, used in TIMEOUT_ITEM.
@@ -74,8 +73,7 @@
* The item for the id of an Coordination object. The key is TIMEOUT and the
* type is SimpleType.LONG.
*/
- public static final org.osgi.jmx.Item TIMEOUT_ITEM = new Item(TIMEOUT,
- null, SimpleType.LONG, (String[]) null);
+ public static final org.osgi.jmx.Item TIMEOUT_ITEM = new Item(TIMEOUT, null, SimpleType.LONG, (String[]) null);
/**
* The key COORDINATION, used in COORDINATION_TYPE
@@ -85,8 +83,8 @@
/**
* Interface Coordination
*/
- public static final CompositeType COORDINATION_TYPE = Item.compositeType(
- "", null, ID_ITEM, NAME_ITEM, TIMEOUT_ITEM);
+ public static final CompositeType COORDINATION_TYPE = Item
+ .compositeType("", null, ID_ITEM, NAME_ITEM, TIMEOUT_ITEM);
/**
* The key COORDINATIONS, used in COORDINATIONS_TYPE
@@ -99,17 +97,17 @@
/**
* Defines a list of COORDINATION_TYPE
* <p>
- * fmeschbe note: The draft 2 spec defines this to be ArrayType but to
- * use it for {@link #listCoordinations(String)} this constant must
- * be a <code>TabularType</code>.
+ * fmeschbe note: The draft 2 spec defines this to be ArrayType but to use
+ * it for {@link #listCoordinations(String)} this constant must be a
+ * <code>TabularType</code>.
*/
- public static final TabularType COORDINATIONS_TYPE = Item.tabularType(
- COORDINATIONS, null, COORDINATION_TYPE, ID, NAME, TIMEOUT);
+ public static final TabularType COORDINATIONS_TYPE = Item.tabularType(COORDINATIONS, null, COORDINATION_TYPE, ID,
+ NAME, TIMEOUT);
/**
* List the current coordinations. The Composite Data is typed by
* COORDINATIONS_TYPE.
- *
+ *
* @param regexFilter a regular expression filter on the coordination name
* @return the Coordinations typed by COORDINATIONS_TYPE.
* @throws IOException if the operation fails
@@ -118,7 +116,7 @@
/**
* Get a Coordination. The Composite Data is typed by COORDINATION_TYPE.
- *
+ *
* @param id The id of a Coordination
* @return the Coordinations typed by COORDINATION_TYPE.
* @throws IOException if the operation fails
@@ -127,7 +125,7 @@
/**
* Fail a Coordination.
- *
+ *
* @param id The id of the coordination to be failed.
* @param reason The reason the coordination should be failed. The
* implementation of the MBean should create a
@@ -142,7 +140,7 @@
/**
* Set/Change the timeout of a Coordination.
- *
+ *
* @param id The id of the Coordination
* @param timeout The nr of milliseconds for the next timeout.
* @throws IOException
diff --git a/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/package-info.java b/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/package-info.java
index 5989a55..1fbc826 100644
--- a/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/package-info.java
+++ b/coordinator/src/main/java/org/apache/felix/jmx/service/coordination/package-info.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -22,8 +22,7 @@
* This package has two types of users: the consumers that use the API in this
* package and the providers that implement the API in this package.
* <p>
- * Example import for consumers using the API in this package:
- * <blockquote>
+ * Example import for consumers using the API in this package: <blockquote>
* <code>Import-Package: org.apache.felix.jmx.service.coordination; version="[1.0,2.0)"; status="provisional"</code>
* </blockquote>
* <p>
@@ -31,7 +30,7 @@
* <blockquote>
* <code>Import-Package: org.apache.felix.jmx.service.coordination; version="[1.0,1.1)"; status="provisional"</code>
* </blockquote>
- *
+ *
* @Provisional
*/
@Deprecated
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java b/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java
index d43731c..2686d8f 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -24,12 +24,13 @@
* Participant objects. When the Coordination is ended, the participants are
* called back. A Coordination can also fail for various reasons, in that case
* the participants are informed of this failure.
- *
+ *
* @ThreadSafe
* @Provisional
*/
@Deprecated
-public interface Coordination {
+public interface Coordination
+{
/**
* Return value of end(). The Coordination ended normally, no participant
* threw an exception.
@@ -56,7 +57,7 @@
/**
* Return the name of this Coordination. The name is given in the
* Coordinator.begin(String) or Coordinator.create(String) method.
- *
+ *
* @return the name of this Coordination
*/
String getName();
@@ -71,7 +72,7 @@
* methods must be running outside the current coordination, no participants
* can be added during the termination phase. A fail method must return
* silently when the Coordination has already finished.
- *
+ *
* @param reasonThrowable describing the reason of the failure for
* documentation
* @return true if the Coordination was still active, otherwise false
@@ -82,7 +83,7 @@
* If the Coordination is terminated then return, otherwise set the
* Coordination to fail. This method enables the following fail-safe pattern
* to ensure Coordinations are properly terminated.
- *
+ *
* <pre>
* Coordination c = coordinator.begin("show_fail");
* try {
@@ -99,7 +100,7 @@
* <p>
* With this pattern, it is easy to ensure that the coordination is always
* terminated.
- *
+ *
* @return true if this method actually terminated the coordination (that
* is, it was not properly ended). false if the Coordination was
* already properly terminate by an end() or fail(Throwable) method.
@@ -120,7 +121,7 @@
* <li>PARTIALLY_ENDED - One of the participants threw an exception</li>
* <li>FAILED - The Coordination was set to always fail</li>
* </ol>
- *
+ *
* @return OK, PARTIALLY_ENDED, FAILED
* @throws IllegalStateException when the Coordination is already
* terminated.
@@ -132,7 +133,7 @@
* This list is only valid as long as the Coordination has not been
* terminated. That is, after end() or fail(Throwable) is called this method
* will return an empty list.
- *
+ *
* @return list of participants.
* @throws SecurityException This method requires the action for the
* CoordinationPermission.
@@ -156,7 +157,7 @@
* that is, before end() or fail(Throwable) is called. If the current
* deadline is arriving later than the given timeout then the timeout is
* ignored.
- *
+ *
* @param timeOutInMsNumber of ms to wait, zero means forever.
* @throws SecurityException This method requires the or action for the
* CoordinationPermission. participate
@@ -178,7 +179,7 @@
* happen before this method returns. The ordering of the call-backs must
* follow the order of participation. If participant is participating
* multiple times the first time it participates defines this order.
- *
+ *
* @return true if the Coordination was active, otherwise false.
* @throws CoordinationException - This exception should normally not be
* caught by the caller but allowed to bubble up to the
@@ -202,7 +203,7 @@
* participants. To namespace of the map is a class, allowing for private
* date to be stored in the map by using implementation classes or shared
* data by interfaces.
- *
+ *
* @return The map
*/
Map<Class<?>, ?> getVariables();
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationException.java b/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationException.java
index 3e180cf..8221fe0 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationException.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationException.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -18,11 +18,12 @@
/**
* Thrown when an implementation detects a potential deadlock situation that it
* cannot solve. The name of the current coordination is given as argument.
- *
+ *
* @Provisional
*/
@Deprecated
-public class CoordinationException extends RuntimeException {
+public class CoordinationException extends RuntimeException
+{
private static final long serialVersionUID = -4466063711012717361L;
@@ -47,12 +48,13 @@
/**
* Create a new Coordination Exception.
- *
+ *
* @param message The message
* @param name The name of the Coordination
* @param reason The reason for the exception.
*/
- public CoordinationException(String message, String name, int reason) {
+ public CoordinationException(String message, String name, int reason)
+ {
super(message);
this.name = name;
this.reason = reason;
@@ -60,19 +62,21 @@
/**
* Answer the name of the Coordination associated with this exception.
- *
+ *
* @return the Coordination name
*/
- public String getName() {
+ public String getName()
+ {
return name;
}
/**
* Answer the reason.
- *
+ *
* @return the reason
*/
- public int getReason() {
+ public int getReason()
+ {
return reason;
}
}
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationPermission.java b/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationPermission.java
index 5dd765f..f0cedb7 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationPermission.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/CoordinationPermission.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -82,11 +82,12 @@
* </table>
* </li>
* </ol>
- *
+ *
* @Provisional
*/
@Deprecated
-public class CoordinationPermission extends BasicPermission {
+public class CoordinationPermission extends BasicPermission
+{
private static final long serialVersionUID = 1566605398519619478L;
@@ -110,27 +111,28 @@
* The name parameter specifies a filter condition. The filter asserts the
* bundle that initiated the Coordination. An implicit grant is made for a
* bundle's own coordinations. Parameters:
- *
+ *
* @param filterExpression A filter expression asserting the bundle
* associated with the coordination.
* @param actions A comma separated combination of INITIATE, ADMIN,
* PARTICIPATE.
*/
- public CoordinationPermission(String filterExpression, String actions) {
+ public CoordinationPermission(String filterExpression, String actions)
+ {
super(filterExpression, actions);
}
/**
* The verification permission
- *
+ *
* @param bundle The bundle that will be the target of the filter
* expression.
* @param coordinationName The name of the coordination or null
* @param actions The set of actions required, which is a combination of
* INITIATE, ADMIN, PARTICIPATE.
*/
- public CoordinationPermission(org.osgi.framework.Bundle bundle,
- String coordinationName, String actions) {
+ public CoordinationPermission(org.osgi.framework.Bundle bundle, String coordinationName, String actions)
+ {
super(coordinationName, actions);
}
}
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/Coordinator.java b/coordinator/src/main/java/org/apache/felix/service/coordination/Coordinator.java
index c42f9fc..4b49591 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/Coordinator.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/Coordinator.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -38,52 +38,63 @@
* unless overridden with configuration. This time can be set on a per
* Coordination basis with the Coordination.addTimeout(long) method. The typical
* usage of the Coordinator service is as follows:
- *
+ *
* <pre>
* Coordination coordination = coordinator.begin("mycoordination");
- * try {
+ * try
+ * {
* doWork();
- * if (coordination.end() != Coordination.OK) log("failed");
- * } finally {
+ * if (coordination.end() != Coordination.OK)
+ * log("failed");
+ * }
+ * finally
+ * {
* coordination.terminate();
* }
* </pre>
* <p>
* In the doWork() method, code can be called that requires a callback at the
* end of the Coordination. This code is for a Participant.
- *
+ *
* <pre>
- * void doWork() {
- * if (coordinator.participate(this)) {
+ * void doWork()
+ * {
+ * if (coordinator.participate(this))
+ * {
* beginWork();
- * } else {
+ * }
+ * else
+ * {
* beginWork();
* finishWork();
* }
* }
- *
- * void ended() {
+ *
+ * void ended()
+ * {
* finishWork();
* }
- *
- * void failed() {
+ *
+ * void failed()
+ * {
* undoWork();
* }
* </pre>
* <p>
* Life cycle. All Coordinations that are begun through this service must
* automatically fail before this service is ungotten.
- *
+ *
* @ThreadSafe
* @Provisional
*/
@Deprecated
-public interface Coordinator {
+public interface Coordinator
+{
/**
* Create a new Coordination that is not associated with the current thread.
* Parameters:
- *
+ *
* @param name The name of this coordination, a name does not have to be
* unique.
* @return The new Coordination object or null
@@ -95,7 +106,7 @@
/**
* Begin a new Coordination and push it on the thread local stack with
* push(Coordination). Parameters:
- *
+ *
* @param name The name of this coordination, a name does not have to be
* unique.
* @return A new Coordination object
@@ -109,7 +120,7 @@
* top of the thread local stack is returned with the
* getCurrentCoordination() method. To remove the Coordination from the top
* call pop().
- *
+ *
* @param c The Coordination to push
* @return c (for the builder pattern purpose)
*/
@@ -118,7 +129,7 @@
/**
* Pop the top of the thread local stack of Coordinations. If no current
* Coordination is present, return null.
- *
+ *
* @return The top of the stack or null
*/
Coordination pop();
@@ -128,7 +139,7 @@
* This method calls getCurrentCoordination(), if it is null, it will return
* false. Otherwise it will call Coordination.participate(Participant) and
* return the result of that method.
- *
+ *
* @param participant The participant of the Coordination
* @return true if there was a current Coordination that could be
* successfully used to participate, otherwise false.
@@ -152,7 +163,7 @@
* Always fail the current Coordination, if exists. Must fail the current
* Coordination and return true or return false if there is no current
* Coordination.
- *
+ *
* @param reason Throwable describing why the collaboration must always fail
* for debugging or null.
* @return true if there was a current Coordination and false if not.
@@ -163,7 +174,7 @@
* Return the current Coordination. The current Coordination is the top of
* the thread local stack of Coordinations. If the stack is empty, there is
* no current Coordination.
- *
+ *
* @return null when the thread local stack is empty, otherwise the top of
* the thread local stack of Coordinations.
*/
@@ -176,7 +187,7 @@
* objects are capabilities and designed to be used only on the Coordination
* thread. The returned list must only contain the Coordinations for which
* the caller has , without this permission an empty list must be returned.
- *
+ *
* @return a list of Coordination objects
*/
Collection<Coordination> getCoordinations();
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/Participant.java b/coordinator/src/main/java/org/apache/felix/service/coordination/Participant.java
index 2348c24..4a40c66 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/Participant.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/Participant.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -28,18 +28,19 @@
* ended(Coordination) method and the failed(Coordination) method. Both methods
* can be called on another thread. A Coordinator service must block a
* Participant when it tries to participate in multiple Coordinations.
- *
+ *
* @ThreadSafe
* @Provisional
*/
@Deprecated
-public interface Participant {
+public interface Participant
+{
/**
* The Coordination has failed and the participant is informed. A
* participant should properly discard any work it has done during the
* active coordination.
- *
+ *
* @param c The Coordination that does the callback
* @throws Exception Any exception thrown should be logged but is further
* ignored and does not influence the outcome of the
@@ -49,7 +50,7 @@
/**
* The Coordination is being ended.
- *
+ *
* @param c The Coordination that does the callback
* @throws Exception If an exception is thrown it should be logged and the
* return of the Coordination.end() method must be
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/package-info.java b/coordinator/src/main/java/org/apache/felix/service/coordination/package-info.java
index 79837d3..fe64004 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/package-info.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/package-info.java
@@ -1,12 +1,12 @@
/*
* Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
- *
+ *
* 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
- *
+ *
+ * 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.
@@ -19,11 +19,10 @@
* Bundles wishing to use this package must list the package in the
* Import-Package header of the bundle's manifest.
* <p>
- * This package has two types of users: the consumers that use the API in
- * this package and the providers that implement the API in this package.
+ * This package has two types of users: the consumers that use the API in this
+ * package and the providers that implement the API in this package.
* <p>
- * Example import for consumers using the API in this package:
- * <blockquote>
+ * Example import for consumers using the API in this package: <blockquote>
* <code>Import-Package: org.apache.felix.service.coordination; version="[1.0,2.0)"; status="provisional"</code>
* </blockquote>
* <p>
@@ -31,7 +30,7 @@
* <blockquote>
* <code>Import-Package: org.apache.felix.service.coordination; version="[1.0,1.1)"; status="provisional"</code>
* </blockquote>
- *
+ *
* @Provisional
*/
@Deprecated