本文整理了Java中org.eclipse.californium.core.network.Endpoint.destroy()
方法的一些代码示例,展示了Endpoint.destroy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Endpoint.destroy()
方法的具体详情如下:
包路径:org.eclipse.californium.core.network.Endpoint
类名称:Endpoint
方法名:destroy
[英]Destroys this endpoint and all its components. A destroyed endpoint cannot be started again.
[中]销毁此终结点及其所有组件。无法再次启动已销毁的终结点。
代码示例来源:origin: org.eclipse.californium/californium-core
/**
* Reset default endpoints. Destroy all default endpoints.
*/
public static void reset() {
EndpointManager it = getEndpointManager();
if (it.default_endpoint != null) {
it.default_endpoint.destroy();
it.default_endpoint = null;
}
if (it.default_secure_endpoint != null) {
it.default_secure_endpoint.destroy();
it.default_secure_endpoint = null;
}
}
代码示例来源:origin: eclipse/californium
/**
* Reset default endpoints. Destroy all default endpoints and clear their
* set.
*/
public static void reset() {
EndpointManager it = getEndpointManager();
if (it.default_endpoint != null) {
it.default_endpoint.destroy();
it.default_endpoint = null;
}
if (it.default_secure_endpoint != null) {
it.default_secure_endpoint.destroy();
it.default_secure_endpoint = null;
}
if (it.default_tcp_endpoint != null) {
it.default_tcp_endpoint.destroy();
it.default_tcp_endpoint = null;
}
if (it.default_secure_tpc_endpoint != null) {
it.default_secure_tpc_endpoint.destroy();
it.default_secure_tpc_endpoint = null;
}
}
代码示例来源:origin: org.eclipse.californium/californium-core
/**
* Destroys the server, i.e., unbinds from all ports and frees all system resources.
*/
@Override
public void destroy() {
LOGGER.info("Destroy server");
for (Endpoint ep:endpoints)
ep.destroy();
executor.shutdown(); // cannot be started again
try {
boolean succ = executor.awaitTermination(5, TimeUnit.SECONDS);
if (!succ)
LOGGER.warning("Server executor did not shutdown in time");
} catch (InterruptedException e) {
LOGGER.log(Level.WARNING, "Exception while terminating server executor", e);
}
}
代码示例来源:origin: eclipse/californium
} finally {
for (Endpoint ep : endpoints) {
ep.destroy();
代码示例来源:origin: org.eclipse.californium/californium-core
/**
* Configures a new default endpoint. Any old default endpoint is destroyed.
* @param endpoint the new default endpoint
*/
public void setDefaultEndpoint(Endpoint endpoint) {
if (this.default_endpoint!=null) {
this.default_endpoint.destroy();
}
LOGGER.config(endpoint.getAddress()+" becomes default endpoint");
this.default_endpoint = endpoint;
if (!this.default_endpoint.isStarted()) {
try {
default_endpoint.start();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not start new default endpoint", e);
}
}
}
代码示例来源:origin: org.eclipse.californium/californium-core
/**
* Configures a new default secure endpoint. Any old default endpoint is destroyed.
* @param endpoint the new default endpoint
*/
public void setDefaultSecureEndpoint(Endpoint endpoint) {
if (this.default_secure_endpoint!=null) {
this.default_secure_endpoint.destroy();
}
this.default_secure_endpoint = endpoint;
if (!this.default_secure_endpoint.isStarted()) {
try {
default_secure_endpoint.start();
LOGGER.log(Level.INFO, "Started new default secure endpoint " + default_secure_endpoint.getAddress());
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not start new default secure endpoint", e);
}
}
}
代码示例来源:origin: eclipse/californium
/**
* Configures a new default secure endpoint. Any old default endpoint is
* destroyed.
*
* @param endpoint
* the new default endpoint
*/
public synchronized void setDefaultSecureEndpoint(Endpoint endpoint) {
if (this.default_secure_endpoint != null) {
this.default_secure_endpoint.destroy();
}
this.default_secure_endpoint = endpoint;
if (!this.default_secure_endpoint.isStarted()) {
try {
default_secure_endpoint.start();
LOGGER.log(Level.INFO, "Started new default secure endpoint {0}", default_secure_endpoint.getAddress());
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not start new default secure endpoint", e);
}
}
}
代码示例来源:origin: eclipse/californium
/**
* Configures a new default endpoint. Any old default endpoint is destroyed.
*
* @param endpoint
* the new default endpoint
*/
public synchronized void setDefaultEndpoint(Endpoint endpoint) {
if (this.default_endpoint != null) {
this.default_endpoint.destroy();
}
LOGGER.log(Level.CONFIG, "{0} becomes default endpoint", endpoint.getAddress());
this.default_endpoint = endpoint;
if (!this.default_endpoint.isStarted()) {
try {
default_endpoint.start();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not start new default endpoint", e);
}
}
}
代码示例来源:origin: eclipse/californium
/**
* Configures a new secure tcp endpoint to use by default. Any old tcp
* endpoint is destroyed.
*
* @param endpoint
* the new default secure tcp endpoint.
*/
public synchronized void setTcpEndpoint(Endpoint endpoint) {
if (this.default_tcp_endpoint != null) {
this.default_tcp_endpoint.destroy();
}
LOGGER.log(Level.CONFIG, "{0} becomes tcp endpoint", endpoint.getAddress());
this.default_tcp_endpoint = endpoint;
if (!this.default_tcp_endpoint.isStarted()) {
try {
default_tcp_endpoint.start();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not start new tcp endpoint", e);
}
}
}
代码示例来源:origin: eclipse/californium
/**
* Configures a new secure tcp endpoint to use by default. Any old tcp
* endpoint is destroyed.
*
* @param endpoint
* the new default secure tcp endpoint.
*/
public synchronized void setSecureTcpEndpoint(Endpoint endpoint) {
if (this.default_secure_tpc_endpoint != null) {
this.default_secure_tpc_endpoint.destroy();
}
LOGGER.log(Level.CONFIG, "{0} becomes secure tcp endpoint", endpoint.getAddress());
this.default_secure_tpc_endpoint = endpoint;
if (!this.default_secure_tpc_endpoint.isStarted()) {
try {
default_secure_tpc_endpoint.start();
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not start new secure tcp endpoint", e);
}
}
}
代码示例来源:origin: eclipse/californium
@After
public void destroyClient() throws Exception {
clientEndpoint.destroy();
}
代码示例来源:origin: eclipse/californium
@After
public void shutdownServer() {
if (server != null) {
server.destroy();
}
if (client != null) {
client.destroy();
}
System.out.println(System.lineSeparator() + "End " + getClass().getSimpleName());
}
代码示例来源:origin: eclipse/californium
@After
public void shutdownServer() {
System.out.println();
server.destroy();
clientEndpoint.destroy();
middle.stop();
System.out.printf("End %s", getClass().getSimpleName());
}
代码示例来源:origin: eclipse/californium
@After
public void shutdownEndpoints() {
client.destroy();
server.destroy();
}
代码示例来源:origin: eclipse/californium
@After
public void shutdownEndpoints() {
client.destroy();
server.destroy();
}
内容来源于网络,如有侵权,请联系作者删除!