<s> from pyon . core . interceptor . interceptor import Interceptor <EOL> from pyon . util . log import log <EOL> class SampleInterceptor ( Interceptor ) : <EOL> def outgoing ( self , invocation ) : <EOL> log . debug ( "<STR_LIT>" , invocation ) <EOL> invocation . headers [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> return invocation <EOL> def incoming ( self , invocation ) : <EOL> log . debug ( "<STR_LIT>" , invocation ) <EOL> if invocation . headers . has_key ( '<STR_LIT>' ) : <EOL> log . debug ( "<STR_LIT>" ) <EOL> else : <EOL> log . debug ( "<STR_LIT>" ) <EOL> return invocation <EOL> class SampleProcessOnlyInterceptor ( Interceptor ) : <EOL> def outgoing ( self , invocation ) : <EOL> log . debug ( "<STR_LIT>" , invocation ) <EOL> invocation . headers [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> return invocation <EOL> def incoming ( self , invocation ) : <EOL> log . debug ( "<STR_LIT>" , invocation ) <EOL> if invocation . headers . has_key ( '<STR_LIT>' ) : <EOL> log . debug ( "<STR_LIT>" ) <EOL> else : <EOL> log . debug ( "<STR_LIT>" ) <EOL> return invocation </s>
