Class StubBase
Definition
- Namespace:
- Tizen.Applications.RPCPort
- Assembly:
- Tizen.Applications.Common.dll
Abstract class for creating a stub class for RPC.
public abstract class StubBase : IDisposable
- Inheritance
-
objectStub
Base
- Implements
-
System.
IDisposable
Constructors
View SourceStubBase(string)
Constructor for this class.
Declaration
public StubBase(string portName)
Parameters
Type | Name | Description |
---|---|---|
string | portName | The name of the port that wants to listen. |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown when an internal IO error occurs. |
Properties
View SourcePortName
Gets port name.
Declaration
public string PortName { get; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceAddPrivilege(string)
Adds a privilege to the stub.
Declaration
protected void AddPrivilege(string privilege)
Parameters
Type | Name | Description |
---|---|---|
string | privilege | The privilege to access this stub. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when the privilege is null. |
Dispose()
Release all the resources used by the class StubBase.
Declaration
public void Dispose()
~StubBase()
Finalizer of the class StubBase.
Declaration
protected ~StubBase()
GetPort(Type, string)
Gets s port.
Declaration
protected Port GetPort(Port.Type t, string instance)
Parameters
Type | Name | Description |
---|---|---|
Port.Type | t | The type of port. |
string | instance | The ID of the instance, which is connected. |
Returns
Type | Description |
---|---|
Port | Port object. |
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown when invalid instance is used. |
Invalid |
Thrown when an internal IO error occurs. |
Listen()
Listens to the requests for connections.
Declaration
protected void Listen()
Exceptions
Type | Condition |
---|---|
Invalid |
Thrown when an internal IO error occurs. |
OnConnectedEvent(string, string)
Abstract method for receiving connected event.
Declaration
protected abstract void OnConnectedEvent(string sender, string instance)
Parameters
Type | Name | Description |
---|---|---|
string | sender | The target proxy app ID. |
string | instance | The information about the request. |
OnDisconnectedEvent(string, string)
Abstract method for receiving disconnected event.
Declaration
protected abstract void OnDisconnectedEvent(string sender, string instance)
Parameters
Type | Name | Description |
---|---|---|
string | sender | The target proxy app ID. |
string | instance | The information about the request. |
OnReceivedEvent(string, string, Port)
Abstract method called when the stub receives data from proxy.
Declaration
protected abstract bool OnReceivedEvent(string sender, string instance, Port port)
Parameters
Type | Name | Description |
---|---|---|
string | sender | The target proxy app ID. |
string | instance | The information about the request. |
Port | port | Port object for reading and writing. |
Returns
Type | Description |
---|---|
bool |
|
OnTerminatedEvent()
Abstract method called immediately before disposing an object.
Declaration
protected abstract void OnTerminatedEvent()
SetTrusted(bool)
Sets a trusted proxy to the stub.
Declaration
protected void SetTrusted(bool trusted)
Parameters
Type | Name | Description |
---|---|---|
bool | trusted | Whether stub allows only trusted proxy or not. |