本文整理汇总了Java中javax.net.ssl.SSLSessionBindingListener类的典型用法代码示例。如果您正苦于以下问题:Java SSLSessionBindingListener类的具体用法?Java SSLSessionBindingListener怎么用?Java SSLSessionBindingListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SSLSessionBindingListener类属于javax.net.ssl包,在下文中一共展示了SSLSessionBindingListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
@Override
public synchronized void putValue(String name, Object value) {
if (name == null) {
throw new IllegalArgumentException(Messages.MESSAGES.nameWasNull());
}
if (value == null) {
throw new IllegalArgumentException(Messages.MESSAGES.valueWasNull());
}
Map<String, Object> values = this.values;
if (values == null) {
// Use size of 2 to keep the memory overhead small
values = this.values = new HashMap<>(2);
}
Object old = values.put(name, value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
}
notifyUnbound(old, name);
}
示例2: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
@Override
public void putValue(String name, Object value) {
ObjectUtil.checkNotNull(name, "name");
ObjectUtil.checkNotNull(value, "value");
Map<String, Object> values = this.values;
if (values == null) {
// Use size of 2 to keep the memory overhead small
values = this.values = new HashMap<String, Object>(2);
}
Object old = values.put(name, value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
}
notifyUnbound(old, name);
}
示例3: test_getValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
/**
* javax.net.ssl.SSLSession#getValue(String name)
*/
public void test_getValue() {
SSLSession s = clientSession;
mySSLSessionBindingListener sbl = new mySSLSessionBindingListener();
try {
s.getValue(null);
fail("IllegalArgumentException wasn't thrown");
} catch (IllegalArgumentException expected) {
// expected
}
s.putValue("Name", sbl);
Object obj = s.getValue("Name");
assertTrue(obj instanceof SSLSessionBindingListener);
}
示例4: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
/**
* @see javax.net.ssl.SSLSession.putValue(String name, Object value)
*/
public void putValue(String name, Object value) {
if (name == null || value == null) {
throw new IllegalArgumentException("Parameter is null");
}
Object old = values.put(name, AccessController.getContext(), value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value)
.valueBound(new SSLSessionBindingEvent(this, name));
}
if (old != null && old instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) old)
.valueUnbound(new SSLSessionBindingEvent(this, name));
}
}
示例5: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
@Override
public void putValue(String name, Object value) {
if (name == null || value == null) {
throw new IllegalArgumentException("name == null || value == null");
}
Object old = values.put(name, value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
}
if (old instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
}
}
示例6: removeValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
@Override
public void removeValue(String name) {
if (name == null) {
throw new IllegalArgumentException("name == null");
}
Object old = values.remove(name);
if (old instanceof SSLSessionBindingListener) {
SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
listener.valueUnbound(new SSLSessionBindingEvent(this, name));
}
}
示例7: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void putValue(String name, Object value)
{
values.put(name, value);
try
{
if (value instanceof SSLSessionBindingListener)
((SSLSessionBindingListener) value).valueBound
(new SSLSessionBindingEvent(this, name));
}
catch (Exception x)
{
}
}
示例8: removeValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void removeValue(String name)
{
Object value = values.remove(name);
try
{
if (value instanceof SSLSessionBindingListener)
((SSLSessionBindingListener) value).valueUnbound
(new SSLSessionBindingEvent(this, name));
}
catch (Exception x)
{
}
}
示例9: removeValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void removeValue(String name)
{
Object value = values.remove(name);
try
{
if (value instanceof SSLSessionBindingListener)
((SSLSessionBindingListener) value).valueUnbound
(new SSLSessionBindingEvent(this, name));
}
catch (Exception x)
{
}
}
示例10: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void putValue(String s, Object obj) {
if(s == null || obj == null)
throw new IllegalArgumentException("arguments can not be null");
Object obj1 = table.put(s, obj);
if(obj1 instanceof SSLSessionBindingListener) {
SSLSessionBindingEvent sslsessionbindingevent = new SSLSessionBindingEvent(this, s);
((SSLSessionBindingListener)obj1).valueUnbound(sslsessionbindingevent);
}
if(obj instanceof SSLSessionBindingListener) {
SSLSessionBindingEvent sslsessionbindingevent1 = new SSLSessionBindingEvent(this, s);
((SSLSessionBindingListener)obj).valueBound(sslsessionbindingevent1);
}
}
示例11: removeValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void removeValue(String s) {
if(s == null)
throw new IllegalArgumentException("argument can not be null");
Object obj = table.remove(s);
if(obj instanceof SSLSessionBindingListener) {
SSLSessionBindingEvent sslsessionbindingevent = new SSLSessionBindingEvent(this, s);
((SSLSessionBindingListener)obj).valueUnbound(sslsessionbindingevent);
}
}
示例12: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void putValue(String name, Object value) {
if (name == null || value == null) {
throw new IllegalArgumentException("Parameter is null");
}
Object old = values.put(new ValueKey(name), value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
}
if (old instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
}
}
示例13: removeValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void removeValue(String name) {
if (name == null) {
throw new IllegalArgumentException("Parameter is null");
}
Object old = values.remove(new ValueKey(name));
if (old instanceof SSLSessionBindingListener) {
SSLSessionBindingListener listener = (SSLSessionBindingListener) old;
listener.valueUnbound(new SSLSessionBindingEvent(this, name));
}
}
示例14: putValue
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
public void putValue(String name, Object value) {
if (name == null || value == null) {
throw new IllegalArgumentException("Parameter is null");
}
Object old = values.put(new ValueKey(name), value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
}
if (old != null && old instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
}
}
示例15: notifyUnbound
import javax.net.ssl.SSLSessionBindingListener; //导入依赖的package包/类
private void notifyUnbound(Object value, String name) {
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value)
.valueUnbound(new SSLSessionBindingEvent(this, name));
}
}