Skip to main content
Jump to: navigation, search

Difference between revisions of "Swordfish Documentation: Architecture: Interceptor Framework"

(Option 2 (proposed by Zsolt))
Line 1: Line 1:
== Option 1 (proposed by Jürgen) ==
+
== Option 1 (proposed by Jürgen) ==
[[Image:Interceptor_Framework_Option1.png]]
+
Example of interceptor registration:
+
<pre>
+
<bean id="exampleInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleInterceptor"/>
+
  
<osgi:service ref="exampleInterceptor">
+
[[Image:Interceptor Framework Option1.png]]
<osgi:interfaces>
+
<value>org.eclipse.swordfish.core.ConsReqInterceptor</value>
+
<value>org.eclipse.swordfish.core.ConsResInterceptor</value>
+
<value>org.eclipse.swordfish.core.ProvReqInterceptor</value>
+
<value>org.eclipse.swordfish.core.ProvresInterceptor</value>
+
</osgi:interfaces>
+
</osgi:service>
+
</pre>
+
  
== Option 2 (proposed by Zsolt) ==
+
== Example of interceptor registration: ==
[[Image:Interceptor_Framework_Option2.png]]
+
<pre>&lt;bean id="exampleInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleInterceptor"/&gt;
<h1>Example of interceptor registration:</h1>
+
<pre>
+
<bean id="exampleConsReqInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleConsReqInterceptor"/>
+
<bean id="exampleConsResInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleConsResInterceptor"/>
+
<bean id="exampleProvReqInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleProvReqInterceptor"/>
+
<bean id="exampleProvResInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleProvResInterceptor"/>
+
  
<osgi:service ref="exampleConsReqInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
+
&lt;osgi:service ref="exampleInterceptor"&gt;
<osgi:service-properties>
+
&lt;osgi:interfaces&gt;
<entry key=“role“ value=“consumer“/>
+
&lt;value&gt;org.eclipse.swordfish.core.ConsReqInterceptor&lt;/value&gt;
<entry key=“scope“ value=“request“/>
+
&lt;value&gt;org.eclipse.swordfish.core.ConsResInterceptor&lt;/value&gt;
</osgi:service-properties>
+
&lt;value&gt;org.eclipse.swordfish.core.ProvReqInterceptor&lt;/value&gt;
</osgi:service>
+
&lt;value&gt;org.eclipse.swordfish.core.ProvresInterceptor&lt;/value&gt;
<osgi:service ref="exampleConsResInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
+
&lt;/osgi:interfaces&gt;
<osgi:service-properties>
+
&lt;/osgi:service&gt;
<entry key=“role“ value=“consumer“/>
+
</pre>
<entry key=“scope“ value=“response“/>
+
== Option 2 (proposed by Zsolt)  ==
</osgi:service-properties>
+
 
</osgi:service>
+
[[Image:Interceptor Framework Option2.png]]
<osgi:service ref="exampleProviderReqInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
+
 
<osgi:service-properties>
+
== Example of interceptor registration: ==
<entry key=“role“ value=“provider“/>
+
<pre>&lt;bean id="exampleConsReqInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleConsReqInterceptor"/&gt;
<entry key=“scope“ value=“request“/>
+
&lt;bean id="exampleConsResInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleConsResInterceptor"/&gt;
</osgi:service-properties>
+
&lt;bean id="exampleProvReqInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleProvReqInterceptor"/&gt;
</osgi:service>
+
&lt;bean id="exampleProvResInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleProvResInterceptor"/&gt;
<osgi:service ref="exampleProvResInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
+
 
<osgi:service-properties>
+
&lt;osgi:service ref="exampleConsReqInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“&gt;
<entry key=“role“ value=“provider“/>
+
&lt;osgi:service-properties&gt;
<entry key=“scope“ value=“response“/>
+
&lt;entry key=“role“ value=“consumer“/&gt;
</osgi:service-properties>
+
&lt;entry key=“scope“ value=“request“/&gt;
</osgi:service>
+
&lt;/osgi:service-properties&gt;
 +
&lt;/osgi:service&gt;
 +
&lt;osgi:service ref="exampleConsResInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“&gt;
 +
&lt;osgi:service-properties&gt;
 +
&lt;entry key=“role“ value=“consumer“/&gt;
 +
&lt;entry key=“scope“ value=“response“/&gt;
 +
&lt;/osgi:service-properties&gt;
 +
&lt;/osgi:service&gt;
 +
&lt;osgi:service ref="exampleProviderReqInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“&gt;
 +
&lt;osgi:service-properties&gt;
 +
&lt;entry key=“role“ value=“provider“/&gt;
 +
&lt;entry key=“scope“ value=“request“/&gt;
 +
&lt;/osgi:service-properties&gt;
 +
&lt;/osgi:service&gt;
 +
&lt;osgi:service ref="exampleProvResInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“&gt;
 +
&lt;osgi:service-properties&gt;
 +
&lt;entry key=“role“ value=“provider“/&gt;
 +
&lt;entry key=“scope“ value=“response“/&gt;
 +
&lt;/osgi:service-properties&gt;
 +
&lt;/osgi:service&gt;
 
</pre>
 
</pre>

Revision as of 10:32, 12 November 2009

Option 1 (proposed by Jürgen)

Interceptor Framework Option1.png

Example of interceptor registration:

<bean id="exampleInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleInterceptor"/>

<osgi:service ref="exampleInterceptor">
		<osgi:interfaces>
			<value>org.eclipse.swordfish.core.ConsReqInterceptor</value>
			<value>org.eclipse.swordfish.core.ConsResInterceptor</value>
			<value>org.eclipse.swordfish.core.ProvReqInterceptor</value>
			<value>org.eclipse.swordfish.core.ProvresInterceptor</value>
		</osgi:interfaces>
	</osgi:service>

Option 2 (proposed by Zsolt)

Interceptor Framework Option2.png

Example of interceptor registration:

<bean id="exampleConsReqInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleConsReqInterceptor"/>
<bean id="exampleConsResInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleConsResInterceptor"/>
<bean id="exampleProvReqInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleProvReqInterceptor"/>
<bean id="exampleProvResInterceptor" class="org.eclipse.swordfish.plugins.samples.ExampleProvResInterceptor"/>

<osgi:service ref="exampleConsReqInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
		<osgi:service-properties>
			<entry key=“role“ value=“consumer“/>
			<entry key=“scope“ value=“request“/>
		</osgi:service-properties>
</osgi:service>
<osgi:service ref="exampleConsResInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
		<osgi:service-properties>
			<entry key=“role“ value=“consumer“/>
			<entry key=“scope“ value=“response“/>
		</osgi:service-properties>
</osgi:service>
<osgi:service ref="exampleProviderReqInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
		<osgi:service-properties>
			<entry key=“role“ value=“provider“/>
			<entry key=“scope“ value=“request“/>
		</osgi:service-properties>
</osgi:service>
<osgi:service ref="exampleProvResInterceptor" interface=“org.eclipse.swordfish.core.Interceptor“>
		<osgi:service-properties>
			<entry key=“role“ value=“provider“/>
			<entry key=“scope“ value=“response“/>
		</osgi:service-properties>
</osgi:service>

Back to the top