Skip to content

Commit

Permalink
#933: Mark as deprecated for server.(Destroyable, Startable, Stoppable)
Browse files Browse the repository at this point in the history
And make a suggestion to use interfaces that are in the `core` package.

Signed-off-by: moznion <moznion@gmail.com>
Also-by: Simon Bernard <sbernard@sierrawireless.com>
  • Loading branch information
moznion authored and sbernard31 committed Dec 10, 2020
1 parent a60b898 commit 1e9287f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.eclipse.californium.core.network.config.NetworkConfig;
import org.eclipse.californium.core.server.resources.Resource;
import org.eclipse.californium.scandium.DTLSConnector;
import org.eclipse.leshan.core.Destroyable;
import org.eclipse.leshan.core.Startable;
import org.eclipse.leshan.core.Stoppable;
import org.eclipse.leshan.core.californium.CoapResponseCallback;
import org.eclipse.leshan.core.node.codec.CodecException;
import org.eclipse.leshan.core.node.codec.LwM2mNodeDecoder;
Expand All @@ -44,9 +47,6 @@
import org.eclipse.leshan.core.response.LwM2mResponse;
import org.eclipse.leshan.core.response.ResponseCallback;
import org.eclipse.leshan.core.util.Validate;
import org.eclipse.leshan.server.Destroyable;
import org.eclipse.leshan.server.Startable;
import org.eclipse.leshan.server.Stoppable;
import org.eclipse.leshan.server.californium.observation.ObservationServiceImpl;
import org.eclipse.leshan.server.californium.registration.CaliforniumRegistrationStore;
import org.eclipse.leshan.server.californium.registration.RegisterResource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import org.eclipse.californium.core.network.Endpoint;
import org.eclipse.californium.core.network.config.NetworkConfig;
import org.eclipse.californium.core.server.resources.Resource;
import org.eclipse.leshan.core.Destroyable;
import org.eclipse.leshan.core.Startable;
import org.eclipse.leshan.core.Stoppable;
import org.eclipse.leshan.core.model.LwM2mModel;
import org.eclipse.leshan.core.node.codec.LwM2mNodeDecoder;
import org.eclipse.leshan.core.node.codec.LwM2mNodeEncoder;
import org.eclipse.leshan.core.util.Validate;
import org.eclipse.leshan.server.Destroyable;
import org.eclipse.leshan.server.Startable;
import org.eclipse.leshan.server.Stoppable;
import org.eclipse.leshan.server.bootstrap.BootstrapConfigStore;
import org.eclipse.leshan.server.bootstrap.BootstrapHandler;
import org.eclipse.leshan.server.bootstrap.BootstrapHandlerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public void onError(Exception e) {

@Override
public void destroy() {
if (delegatedSender instanceof Destroyable) {
((Destroyable) delegatedSender).destroy();
if (delegatedSender instanceof org.eclipse.leshan.core.Destroyable) {
((org.eclipse.leshan.core.Destroyable) delegatedSender).destroy();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
*******************************************************************************/
package org.eclipse.leshan.server;

public interface Destroyable {
/**
* @deprecated please consider to use {@link org.eclipse.leshan.core.Destroyable} instead. This interface is going to be removed at version 2.0.
*/
@Deprecated
public interface Destroyable extends org.eclipse.leshan.core.Destroyable {

/** Destroy the instances and frees all system resources. */
@Override
void destroy();

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
*******************************************************************************/
package org.eclipse.leshan.server;

public interface Startable {
/**
* @deprecated please consider to use {@link org.eclipse.leshan.core.Startable} instead. This interface is going to be removed at version 2.0.
*/
@Deprecated
public interface Startable extends org.eclipse.leshan.core.Startable {

@Override
void start();

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
*******************************************************************************/
package org.eclipse.leshan.server;

public interface Stoppable {
/**
* @deprecated please consider to use {@link org.eclipse.leshan.core.Stoppable} instead. This interface is going to be removed at version 2.0.
*/
@Deprecated
public interface Stoppable extends org.eclipse.leshan.core.Stoppable {

@Override
void stop();

}

0 comments on commit 1e9287f

Please sign in to comment.