Class ChannelImpl

    • Field Detail

      • channelID

        protected final int channelID
        Client channel ID.
      • name

        protected final String name
        Channel name.
      • priority

        protected final short priority
        Process priority.
      • addresses

        protected final InetSocketAddress[] addresses
        List of fixed addresses, if null name resolution will be used.
      • responseRequests

        protected final Map<Integer,​ResponseRequest> responseRequests
        List of all channel's pending requests (keys are subscription IDs).
      • allowCreation

        protected boolean allowCreation
        Allow reconnection flag.
      • references

        protected int references
        Reference counting. NOTE: synced on this.
      • transport

        protected Transport transport
        Server transport.
      • serverChannelID

        protected int serverChannelID
        Server channel ID.
      • channelDestroyed

        public static final org.epics.pvdata.pv.Status channelDestroyed
      • channelDisconnected

        public static final org.epics.pvdata.pv.Status channelDisconnected
    • Method Detail

      • createChannel

        public void createChannel​(Transport transport)
        Create a channel, i.e. submit create channel request to the server. This method is called after search is complete.
        Parameters:
        transport - on what transport to create channel.
      • createChannelFailed

        public void createChannelFailed()
        Create channel failed.
      • connectionCompleted

        public void connectionCompleted​(int sid)
                                 throws IllegalStateException
        Called when channel created succeeded on the server. sid might not be valid, this depends on protocol revision.
        Parameters:
        sid - server-side channel ID.
        Throws:
        IllegalStateException - when called in wrong state.
      • channelDestroyedOnServer

        public void channelDestroyedOnServer()
      • acquire

        public void acquire()
        Increment reference.
      • disconnect

        public void disconnect​(boolean initiateSearch,
                               boolean remoteDestroy)
        Disconnected notification.
        Parameters:
        initiateSearch - flag to indicate if searching (connect) procedure should be initiated
        remoteDestroy - issue channel destroy request.
      • initiateSearch

        public void initiateSearch​(boolean penalize)
        Initiate search (connect) procedure.
        Parameters:
        penalize - register with penalty.
      • callback

        public void callback()
        Specified by:
        callback in interface org.epics.pvdata.misc.Timer.TimerCallback
      • timerStopped

        public void timerStopped()
        Specified by:
        timerStopped in interface org.epics.pvdata.misc.Timer.TimerCallback
      • searchResponse

        public void searchResponse​(GUID guid,
                                   byte minorRevision,
                                   InetSocketAddress serverAddress)
        Description copied from interface: SearchInstance
        Search response from server (channel found).
        Specified by:
        searchResponse in interface SearchInstance
        Parameters:
        guid - server GUID
        minorRevision - server minor PVA revision.
        serverAddress - server address.
      • getChannelID

        public int getChannelID()
        Get client channel ID.
        Specified by:
        getChannelID in interface SearchInstance
        Returns:
        client channel ID.
      • checkAndGetTransport

        public final Transport checkAndGetTransport()
        Checks if channel is in connected state and returns transport.
        Returns:
        used transport.
        Throws:
        IllegalStateException - if not connected.
      • checkDestroyedAndGetTransport

        public final Transport checkDestroyedAndGetTransport()
        Checks if channel is destroyed and returns transport, null not connected.
        Returns:
        used transport.
        Throws:
        IllegalStateException - if not connected
      • getTransport

        public Transport getTransport()
        Get transport used by this channel.
        Returns:
        transport used by this channel.
      • getServerChannelID

        public int getServerChannelID()
        Get SID.
        Returns:
        SID.
      • registerResponseRequest

        public void registerResponseRequest​(ResponseRequest responseRequest)
        Register a response request.
        Parameters:
        responseRequest - response request to register.
      • unregisterResponseRequest

        public void unregisterResponseRequest​(ResponseRequest responseRequest)
      • getPriority

        public short getPriority()
        Get process priority.
        Returns:
        process priority.
      • connect

        protected final void connect()
      • disconnect

        protected void disconnect()
      • createChannelGet

        public ChannelGet createChannelGet​(ChannelGetRequester channelGetRequester,
                                           org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a ChannelGet. ChannelGetRequester.channelGetReady is called after both client and server are ready for the client to make a get request.
        Specified by:
        createChannelGet in interface Channel
        Parameters:
        channelGetRequester - The interface for notifying when this request is complete and when a channel get completes.
        pvRequest - A structure describing the desired set of fields from the remote PVRecord. This has the same form as a pvRequest to PVCopyFactory.create.
        Returns:
        ChannelGet instance.
      • createMonitor

        public org.epics.pvdata.monitor.Monitor createMonitor​(org.epics.pvdata.monitor.MonitorRequester monitorRequester,
                                                              org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a Monitor.
        Specified by:
        createMonitor in interface Channel
        Parameters:
        monitorRequester - The requester.
        pvRequest - A structure describing the desired set of fields from the remote PVRecord. This has the same form as a pvRequest to PVCopyFactory.create.
        Returns:
        Monitor instance.
      • createChannelProcess

        public ChannelProcess createChannelProcess​(ChannelProcessRequester channelProcessRequester,
                                                   org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a ChannelProcess. ChannelProcessRequester.channelProcessReady is called after both client and server are ready for the client to make a process request.
        Specified by:
        createChannelProcess in interface Channel
        Parameters:
        channelProcessRequester - The interface for notifying when this request is complete and when channel completes processing.
        pvRequest - Additional options (e.g. triggering).
        Returns:
        ChannelProcess instance.
      • createChannelPut

        public ChannelPut createChannelPut​(ChannelPutRequester channelPutRequester,
                                           org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a ChannelPut. ChannelPutRequester.channelPutReady is called after both client and server are ready for the client to make a put request.
        Specified by:
        createChannelPut in interface Channel
        Parameters:
        channelPutRequester - The interface for notifying when this request is complete and when a channel get completes.
        pvRequest - A structure describing the desired set of fields from the remote PVRecord. This has the same form as a pvRequest to PVCopyFactory.create.
        Returns:
        ChannelPut instance.
      • createChannelPutGet

        public ChannelPutGet createChannelPutGet​(ChannelPutGetRequester channelPutGetRequester,
                                                 org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a ChannelPutGet. ChannelPutGetRequester.channelPutGetReady is called after both client and server are ready for the client to make a putGet request.
        Specified by:
        createChannelPutGet in interface Channel
        Parameters:
        channelPutGetRequester - The interface for notifying when this request is complete and when a channel get completes.
        pvRequest - A structure describing the desired set of fields from the remote PVRecord. This has the same form as a pvRequest to PVCopyFactory.create.
        Returns:
        ChannelPutGet instance.
      • createChannelRPC

        public ChannelRPC createChannelRPC​(ChannelRPCRequester channelRPCRequester,
                                           org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a ChannelRPC (Remote Procedure Call).
        Specified by:
        createChannelRPC in interface Channel
        Parameters:
        channelRPCRequester - The requester.
        pvRequest - Request options.
        Returns:
        ChannelRPC instance.
      • getAccessRights

        public AccessRights getAccessRights​(org.epics.pvdata.pv.PVField pvField)
        Description copied from interface: Channel
        Get the access rights for a field of a PVStructure created via a call to createPVStructure. MATEJ Channel access can store this info via auxInfo.
        Specified by:
        getAccessRights in interface Channel
        Parameters:
        pvField - The field for which access rights is desired.
        Returns:
        The access rights.
      • getProvider

        public ChannelProvider getProvider()
        Description copied from interface: Channel
        Get the the channel provider of this channel.
        Specified by:
        getProvider in interface Channel
        Returns:
        The channel provider.
      • isConnected

        public boolean isConnected()
        Description copied from interface: Channel
        Is the channel connected?
        Specified by:
        isConnected in interface Channel
        Returns:
        (false,true) means (not, is) connected.
      • getRequesterName

        public String getRequesterName()
        Specified by:
        getRequesterName in interface org.epics.pvdata.pv.Requester
      • message

        public void message​(String message,
                            org.epics.pvdata.pv.MessageType messageType)
        Specified by:
        message in interface org.epics.pvdata.pv.Requester
      • destroy

        public void destroy()
        Description copied from interface: Channel
        Destroy the channel. It will not honor any further requests.
        Specified by:
        destroy in interface Channel
      • createChannelArray

        public ChannelArray createChannelArray​(ChannelArrayRequester channelArrayRequester,
                                               org.epics.pvdata.pv.PVStructure pvRequest)
        Description copied from interface: Channel
        Create a ChannelArray.
        Specified by:
        createChannelArray in interface Channel
        Parameters:
        channelArrayRequester - The ChannelArrayRequester
        pvRequest - Additional options (e.g. triggering).
        Returns:
        ChannelArray instance.
      • getField

        public void getField​(GetFieldRequester requester,
                             String subField)
        Description copied from interface: Channel
        Get a Field which describes the subField. GetFieldRequester.getDone is called after both client and server have processed the getField request. This is for clients that want to introspect a PVRecord via channel access.
        Specified by:
        getField in interface Channel
        Parameters:
        requester - The requester.
        subField - The name of the subField. If this is null or an empty string the returned Field is for the entire record.
      • lock

        public void lock()
        Specified by:
        lock in interface Lockable
      • send

        public void send​(ByteBuffer buffer,
                         TransportSendControl control)
        Description copied from interface: TransportSender
        Called by transport. By this call transport gives callee ownership over the buffer. Calls on TransportSendControl instance must be made from calling thread. Moreover, ownership is valid only for the time of call of this method. NOTE: these limitations allow efficient implementation.
        Specified by:
        send in interface TransportSender
        Parameters:
        buffer - buffer to send.
        control - transport send control instance.
      • unlock

        public void unlock()
        Specified by:
        unlock in interface Lockable