javaAPI2

------------------------------------------------------------------------------------------------------------------------
RMI
客户端-->远程对象的存根(stub)-->网格-->远程对象的骨架(skeleton)-->远程对象(服务器)
Remote:接口,用于标识其方法可以从非本地虚拟机上调用的接口。任何远程对象都必须直接或间接实现此接口。
    RemoteObject:该 RemoteObject 类实现远程对象的 java.lang.Object 行为,RemoteRef getRef(),ref 对远程对象的引用
        RemoteServer:类,服务器实现的公共超类,创建和导出远程对象所需的功能由子类来实现,
            UnicastRemoteObject:类,用于导出带 JRMP 的远程对象和获得与该远程对象通信的 stub。exportObject(Remote obj)
        RemoteStub:类,客户机 stub 的公共超类,
            RMIConnectionImpl_Stub:类
            RMIServerImpl_Stub:
服务端
  
RemoteRef:接口,远程对象的引用,RemoteStub使用它来调用远程对象。invoke(Remote obj, Method method, Object[] params, long opnum) 
    ServerRef:接口,表示远程对象实现的服务器端句柄。 
Registry:接口,提供存储和获取绑定了任意字符串名称的远程对象引用的方
    RegistryImpl:类,系统自己创建
LocateRegistry:类, createRegistry(int port) 
public class Server 
{
    public static void main(String args[]) throws Exception
    {

        //以1099作为LocateRegistry接收客户端请求的端口,并注册服务的映射关系
        Registry registry=LocateRegistry.createRegistry(1099);

        IOperation iOperation=new OperationImpl();
        Naming.rebind("rmi://127.0.0.1:1099/Operation",iOperation);

        System.out.println("service running...");
    }

}

public interface IOperation extends Remote
{

    /**
     * 远程接口上的方法必须抛出RemoteException,因为网络通信是不稳定的,不能吃掉异常
     * @param a
     * @param b
     * @return
     */
    int add(int a, int b) throws RemoteException;

}

public class OperationImpl extends UnicastRemoteObject implements IOperation
{

    public OperationImpl() throws RemoteException 
    {
        super();
    }

    @Override
    public int add(int a, int b) throws RemoteException
    {
        return a+b;
    }

}

public class OperationImpl extends UnicastRemoteObject implements IOperation
{

    public OperationImpl() throws RemoteException
    {
        super();
    }

    @Override
    public int add(int a, int b) throws RemoteException
    {
        return a+b;
    }

}
-----------------------------------------------------------------------------------------------------------------
Mbean:四种
标准MBean(Standard MBeans)设计和实现是最简单的,这类MBean使用自己的方法名作为管理接口。 
动态MBean(Dynamic MBeans)必须实现一个指定的接口,由于动态MBeans在运行期间暴露它们的管理接口,因此更为灵活。 
开放MBean(Open MBeans)属于动态MBeans,这类MBean依靠基础数据类型来实现通用管理,并为友情用户进行自我声明。 
模型MBean(Model MBeans)同样也是动态MBeans,这类MBeans是完全可配置的,在运行期间进行自我声明;它们为资源动态工具提供一个一般性的,有默认行为的MBeans类。 
MBeanServer:接口,这是在代理端进行 MBean 操作的接口。它包含创建、注册和删除 MBean 所需的方法,
    以及用于已注册 MBean 的存取方法。这是 JMX 基础设施的核心组件。createMBean(String className, ObjectName name) 
    registerMBean(Object object, ObjectName name) 
MBeanServerFactory:类,提供 MBean 服务器引用。没有此类的实例。createMBeanServer() 
MBeanFeatureInfo:类,此类的实例是不可变的。子类可以是可变的,但是不推荐使用此功能。
    MBeanAttributeInfo:描述出于管理目的而公开的 MBean 属性,isReadable() 
        ModelMBeanAttributeInfo:类,getDescriptor() 
        OpenMBeanAttributeInfoSupport:描述 open MBean 的一个属性。 
    MBeanConstructorInfo:类,描述 MBean 所公开的构造方法。MBeanParameterInfo[] getSignature(),返回此构造方法的参数列表
        ModelMBeanConstructorInfo:类,描述了 ModelMBean 的一个构造方法
        OpenMBeanConstructorInfoSupport:类,描述 Open MBean 的构造方法。
    MBeanNotificationInfo:类,用于描述 MBean 向给定的 Java 通知类发出的不同通知实例的特性
        ModelMBeanNotificationInfo:类,
    MBeanOperationInfo:类,描述由 MBean 公开的管理操作,getReturnType() ,MBeanParameterInfo[] getSignature()  
        ModelMBeanOperationInfo:类,描述了 ModelMBean 的管理操作
        OpenMBeanOperationInfoSupport: OpenType<?> getReturnOpenType() 
    MBeanParameterInfo:类,描述由 MBean 公开的操作的参数
        OpenMBeanParameterInfoSupport:类,hasMaxValue() 
MBeanInfo:类,描述为管理操作所提供的属性和操作的集合,getConstructors(),getOperations(),getAttributes(),getNotifications()
    ModelMBeanInfoSupport:类,ModelMBean 的元数据
    OpenMBeanInfoSupport:类
StandardMBean:类
----------------------------------------------------------------------------------------------------------------------------------
SSL(Secure Sockets Layer)
TLS(Transport Layer Security)
ServerSocket:类,
    SSLServerSocket:类,扩展了 ServerSocket 并且提供使用像 Secure Sockets Layer (SSL) 或 Transport Layer Security (TLS) 协议的安全服务器套接字。 
Socket:类
    SSLSocket:类,SSLSession getSession()  
SSLEngine:
---------------------------------------------------------------------------------------------------------------------------------
并发:
Lock:接口,Lock 实现提供了比使用 synchronized 方法和语句可获得的更广泛的锁定操作,lock(),lockInterruptibly(),newCondition(),tryLock(),unlock() 
    ReentrantLock:类,一个可重入的互斥锁 Lock,newCondition() 
    ReentrantReadWriteLock.ReadLock:类,
    ReentrantReadWriteLock.WriteLock:类,
Condition:接口,Condition 将 Object 监视器方法(wait、notify 和 notifyAll)分解成截然不同的对象,await(),signal()
原文地址:https://www.cnblogs.com/wangyonglong/p/7484537.html