Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/landscape/broker/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/landscape/broker/amp.pyc

ó
ÍÿŠTc@sddlmZmZmZddlmZmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZdefd	„ƒYZd
efd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„ZdS(iÿÿÿÿ(t
maybeDeferredtexecutetsucceed(tRemoteObjecttMethodCallArgument(tComponentConnectortget_remote_methods(tBrokerServer(tBrokerClient(tMonitor(tManagertRemoteBrokercBseZd„Zd„ZRS(cs2|jƒ}‡‡‡fd†}|j|ƒ|S(s8Call C{callable} if C{type} is an accepted message type.csˆ|krˆˆŒSdS(N((tresult(tcallabletargsttype(s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pytgot_accepted_typess(tget_accepted_message_typestaddCallback(tselfRR
Rtdeferred_typesR((RR
Rs8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pytcall_if_accepted
s
cs+|jˆjƒƒ}|j‡fd†ƒS(sQCall a given handler as soon as a certain event occurs.

        @param handlers: A dictionary mapping event types to callables, where
            an event type is string (the name of the event). When the first of
            the given event types occurs in the broker reactor, the associated
            callable will be fired.
        csˆ|ƒS(N((t
event_type(thandlers(s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyt<lambda> s(t
listen_eventstkeysR(RRR((Rs8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyt
call_on_events(t__name__t
__module__RR(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyRs	
tFakeRemoteBrokercBs)eZdZd„Zd„Zd„ZRS(s@Looks like L{RemoteBroker}, but actually talks to local objects.cCs||_||_||_dS(N(t	exchangert
message_storet
broker_server(RRR R!((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyt__init__&s		cset|j|dƒ‰|t|jƒkrUˆdk	rUtˆƒrU‡fd†}|St|ƒ‚dS(s~
        Pass attributes through to the real L{BrokerServer}, after checking
        that they're encodable with AMP.
        cshx#|D]}tj|ƒst‚qWx/|jƒD]!\}}tj|ƒs3t‚q3Wtˆ||ŽS(N(RtchecktAssertionErrort	iteritemsR(Rtkwargstargtktv(toriginal(s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pytmethod4s

N(tgetattrR!tNoneRR
tAttributeError(RtnameR+((R*s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyt__getattr__+scGs,||jjƒkr"t||ŒStdƒS(N(R tget_accepted_typesRRR-(RRR
R((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyR>s
(RRt__doc__R"R0R(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyR#s		tRemoteBrokerConnectorcBseZdZeZeZRS(s6Helper to create connections with the L{BrokerServer}.(RRR2RtremoteRt	component(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyR3DstRemoteClientConnectorcBseZdZeZRS(s6Helper to create connections with the L{BrokerServer}.(RRR2RR5(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyR6KstRemoteMonitorConnectorcBseZdZeZRS(s1Helper to create connections with the L{Monitor}.(RRR2R	R5(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyR7QstRemoteManagerConnectorcBseZdZeZRS(s4Helper for creating connections with the L{Monitor}.(RRR2R
R5(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyR8WscCs&ttttg}td„|DƒƒS(sBGet a mapping of component name to connectors, for all components.css!|]}|jj|fVqdS(N(R5R/(t.0t	connector((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pys	<genexpr>fs(R3R6R7R8tdict(tall_connectors((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pytget_component_registry]s	N(ttwisted.internet.deferRRRtlandscape.lib.ampRRt
landscape.ampRRtlandscape.broker.serverRtlandscape.broker.clientRtlandscape.monitor.monitorR	tlandscape.manager.managerR
RtobjectRR3R6R7R8R=(((s8/usr/lib/python2.7/dist-packages/landscape/broker/amp.pyt<module>s!