IT. Expert System.

Android Reference

CommonTimeConfig


android.os

Class CommonTimeConfig



  • public class CommonTimeConfig
    extends Object
    Used for configuring and controlling the status of the android common time service.
    • Method Detail

      • release

        public void release()
        Release all native resources held by this CommonTimeConfig instance. Once resources have been released, the CommonTimeConfig instance is disconnected from the native service and will throw a RemoteException if any of its methods are called. Clients should always call release on their client instances before releasing their last Java reference to the instance. Failure to do this will cause non-deterministic native resource reclamation and may cause the common time service to remain active on the network for longer than it should.
      • getMasterElectionPriority

        public byte getMasterElectionPriority()
                                       throws RemoteException
        Gets the current priority of the common time service used in the master election protocol.
        Returns:
        an 8 bit value indicating the priority of this common time service relative to other common time services operating in the same domain.
        Throws:
        RemoteException
      • setMasterElectionPriority

        public int setMasterElectionPriority(byte priority)
        Sets the current priority of the common time service used in the master election protocol.
        Parameters:
        priority - priority of the common time service used in the master election protocol. Lower numbers are lower priority.
        Returns:
        SUCCESS in case of success, ERROR or ERROR_DEAD_OBJECT in case of failure.
      • getMasterElectionEndpoint

        public InetSocketAddress getMasterElectionEndpoint()
                                                    throws RemoteException
        Gets the IP endpoint used by the time service to participate in the master election protocol.
        Returns:
        an InetSocketAddress containing the IP address and UDP port being used by the system's common time service to participate in the master election protocol.
        Throws:
        RemoteException
      • setMasterElectionEndpoint

        public int setMasterElectionEndpoint(InetSocketAddress ep)
        Sets the IP endpoint used by the common time service to participate in the master election protocol.
        Parameters:
        ep - The IP address and UDP port to be used by the common time service to participate in the master election protocol. The supplied IP address must be either the broadcast or multicast address, unicast addresses are considered to be illegal values.
        Returns:
        SUCCESS in case of success, ERROR, ERROR_BAD_VALUE or ERROR_DEAD_OBJECT in case of failure.
      • getMasterElectionGroupId

        public long getMasterElectionGroupId()
                                      throws RemoteException
        Gets the current group ID used by the common time service in the master election protocol.
        Returns:
        The 64-bit group ID of the common time service.
        Throws:
        RemoteException
      • setMasterElectionGroupId

        public int setMasterElectionGroupId(long id)
        Sets the current group ID used by the common time service in the master election protocol.
        Parameters:
        id - The 64-bit group ID of the common time service.
        Returns:
        SUCCESS in case of success, ERROR, ERROR_BAD_VALUE or ERROR_DEAD_OBJECT in case of failure.
      • getInterfaceBinding

        public String getInterfaceBinding()
                                   throws RemoteException
        Gets the name of the network interface which the common time service attempts to bind to.
        Returns:
        a string with the network interface name which the common time service is bound to, or null if the service is currently unbound. Examples of interface names are things like "eth0", or "wlan0".
        Throws:
        RemoteException
      • setNetworkBinding

        public int setNetworkBinding(String ifaceName)
        Sets the name of the network interface which the common time service should attempt to bind to.
        Parameters:
        ifaceName - The name of the network interface ("eth0", "wlan0", etc...) wich the common time service should attempt to bind to, or null to force the common time service to unbind from the network and run in networkless mode.
        Returns:
        SUCCESS in case of success, ERROR, ERROR_BAD_VALUE or ERROR_DEAD_OBJECT in case of failure.
      • getMasterAnnounceInterval

        public int getMasterAnnounceInterval()
                                      throws RemoteException
        Gets the amount of time the common time service will wait between master announcements when it is the timeline master.
        Returns:
        The time (in milliseconds) between master announcements.
        Throws:
        RemoteException
      • setMasterAnnounceInterval

        public int setMasterAnnounceInterval(int interval)
        Sets the amount of time the common time service will wait between master announcements when it is the timeline master.
        Parameters:
        interval - The time (in milliseconds) between master announcements.
        Returns:
        SUCCESS in case of success, ERROR, ERROR_BAD_VALUE or ERROR_DEAD_OBJECT in case of failure.
      • getClientSyncInterval

        public int getClientSyncInterval()
                                  throws RemoteException
        Gets the amount of time the common time service will wait between time synchronization requests when it is the client of another common time service on the network.
        Returns:
        The time (in milliseconds) between time sync requests.
        Throws:
        RemoteException
      • setClientSyncInterval

        public int setClientSyncInterval(int interval)
        Sets the amount of time the common time service will wait between time synchronization requests when it is the client of another common time service on the network.
        Parameters:
        interval - The time (in milliseconds) between time sync requests.
        Returns:
        SUCCESS in case of success, ERROR, ERROR_BAD_VALUE or ERROR_DEAD_OBJECT in case of failure.
      • getPanicThreshold

        public int getPanicThreshold()
                              throws RemoteException
        Gets the panic threshold for the estimated error level of the common time service. When the common time service's estimated error rises above this level, the service will panic and reset, causing a discontinuity in the currently synchronized timeline.
        Returns:
        The threshold (in microseconds) past which the common time service will panic.
        Throws:
        RemoteException
      • setPanicThreshold

        public int setPanicThreshold(int threshold)
        Sets the panic threshold for the estimated error level of the common time service. When the common time service's estimated error rises above this level, the service will panic and reset, causing a discontinuity in the currently synchronized timeline.
        Parameters:
        threshold - The threshold (in microseconds) past which the common time service will panic.
        Returns:
        SUCCESS in case of success, ERROR, ERROR_BAD_VALUE or ERROR_DEAD_OBJECT in case of failure.
      • getAutoDisable

        public boolean getAutoDisable()
                               throws RemoteException
        Gets the current state of the common time service's auto disable flag.
        Returns:
        The current state of the common time service's auto disable flag.
        Throws:
        RemoteException
      • setAutoDisable

        public int setAutoDisable(boolean autoDisable)
        Sets the current state of the common time service's auto disable flag. When the time service's auto disable flag is set, it will automatically cease all network activity when it has no active local clients, resuming activity the next time the service has interested local clients. When the auto disabled flag is cleared, the common time service will continue to participate the time synchronization group even when it has no active local clients.
        Parameters:
        autoDisable - The desired state of the common time service's auto disable flag.
        Returns:
        SUCCESS in case of success, ERROR or ERROR_DEAD_OBJECT in case of failure.
      • forceNetworklessMasterMode

        public int forceNetworklessMasterMode()
        At startup, the time service enters the initial state and remains there until it is given a network interface to bind to. Common time will be unavailable to clients of the common time service until the service joins a network (even an empty network). Devices may use the forceNetworklessMasterMode() method to force a time service in the INITIAL state with no network configuration to assume MASTER status for a brand new timeline in order to allow clients of the common time service to operate, even though the device is isolated and not on any network. When a networkless master does join a network, it will defer to any masters already on the network, or continue to maintain the timeline it made up during its networkless state if no other masters are detected. Attempting to force a client into master mode while it is actively bound to a network will fail with the status code ERROR
        Returns:
        SUCCESS in case of success, ERROR or ERROR_DEAD_OBJECT in case of failure.
      • setServerDiedListener

        public void setServerDiedListener(CommonTimeConfig.OnServerDiedListener listener)
        Registers an OnServerDiedListener interface.

        Call this method with a null listener to stop receiving server death notifications.

      • finalize

        protected void finalize()
                         throws Throwable
        Description copied from class: Object
        Invoked when the garbage collector has detected that this instance is no longer reachable. The default implementation does nothing, but this method can be overridden to free resources.

        Note that objects that override finalize are significantly more expensive than objects that don't. Finalizers may be run a long time after the object is no longer reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup. Note also that finalizers are run on a single VM-wide finalizer thread, so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary for a class that has a native peer and needs to call a native method to destroy that peer. Even then, it's better to provide an explicit close method (and implement Closeable), and insist that callers manually dispose of instances. This works well for something like files, but less well for something like a BigInteger where typical calling code would have to deal with lots of temporaries. Unfortunately, code that creates lots of temporaries is the worst kind of code from the point of view of the single finalizer thread.

        If you must use finalizers, consider at least providing your own ReferenceQueue and having your own thread process that queue.

        Unlike constructors, finalizers are not automatically chained. You are responsible for calling super.finalize() yourself.

        Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.

        Overrides:
        finalize in class Object
        Throws:
        Throwable


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 848 / . Delta: 0.02264 с