Permalink
Browse files

Changes to ctx broker for standalone: different authZ and GAR include…

…s libs now
  • Loading branch information...
1 parent a9fc909 commit b4def1783d4b283ab534671f59548304396a9559 @timf timf committed Jun 10, 2011
@@ -18,3 +18,4 @@ nimbus.ctxbroker.lib.dir=../lib/services
nimbus.messaging.query.dist.dir=../messaging/query/java/source/dist
nimbus.service.api.dist.dir=../service-api/java/source/dist/
nimbus.authz.dist.dir=../authzdb/dist
+nimbus.querygeneral.dist.dir=../query/dist
View
@@ -72,12 +72,12 @@
<include name="*.jar"/>
</fileset>
- <fileset dir="${nimbus.messaging.query.dist.dir}">
+ <fileset dir="${nimbus.authz.dist.dir}">
<include name="*.jar"/>
</fileset>
- <fileset dir="${nimbus.authz.dist.dir}">
- <include name="*.jar"/>
+ <fileset dir="${nimbus.querygeneral.dist.dir}">
+ <include name="*.jar"/>
</fileset>
<fileset dir="${nimbus.service.api.dist.dir}">
@@ -168,11 +168,19 @@
GAR RELATED
******************************************************************* -->
- <target name="gar">
- <ant dir="${nimbus.ctxbroker.gar.dir}" target="dist" />
+ <target name="gar-bundled">
+ <ant dir="${nimbus.ctxbroker.gar.dir}" target="dist-bundled" />
+ </target>
+
+ <target name="gar-standalone">
+ <ant dir="${nimbus.ctxbroker.gar.dir}" target="dist-standalone" />
+ </target>
+
+ <target name="deploy" depends="dist, gar-bundled">
+ <ant dir="${nimbus.ctxbroker.gar.dir}" target="deploy" />
</target>
- <target name="deploy" depends="dist, gar">
+ <target name="deploy-standalone" depends="dist, gar-standalone">
<ant dir="${nimbus.ctxbroker.gar.dir}" target="deploy" />
</target>
@@ -30,3 +30,9 @@ nimbusctx.gt4_0.service.dist=../dist
# custom build-packages to bundle gar file
nimbus.messaging.gt4_0.gar.build.packages.xml=../../scripts/lib/gt4.0/build/build-packages.xml
+
+nimbusctx.baselibservices.dir=../../lib/services
+nimbusctx.service.api.dist.dir=../../service-api/java/source/dist
+nimbusctx.authzdbmodule.dist.dir=../../authzdb/dist
+nimbusctx.autocommon.dist.dir=../../autocommon/dist
+nimbusctx.querygeneral.dist.dir=../../query/dist
View
@@ -130,6 +130,38 @@
</target>
+
+ <!-- *******************************************************************
+ COPIES FOR LIB DIRECTORY FOR STANDALONE DISTRIBUTION
+ ******************************************************************* -->
+
+ <target name="copy_libraries" depends="init">
+
+ <copy todir="${nimbusctx.gt4_0.gar.build.lib.dir}">
+
+ <fileset dir="${nimbusctx.baselibservices.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
+ <fileset dir="${nimbusctx.service.api.dist.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
+ <fileset dir="${nimbusctx.authzdbmodule.dist.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
+ <fileset dir="${nimbusctx.autocommon.dist.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
+ <fileset dir="${nimbusctx.querygeneral.dist.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
+ </copy>
+ </target>
+
<!-- *******************************************************************
COPIES FOR ETC DIRECTORY
@@ -140,7 +172,19 @@
<fileset dir="${nimbusctx.gt4_0.gar.etc.dir}" />
</copy>
</target>
-
+
+ <target name="copy-bundled-main.xml">
+ <copy tofile="${nimbusctx.gt4_0.gar.etc.dir}/other/main.xml"
+ file="${nimbusctx.gt4_0.gar.etc.dir}/other/bundled-main.xml" />
+ <echo>Broker context: bundled-main.xml</echo>
+ </target>
+
+ <target name="copy-standalone-main.xml">
+ <copy tofile="${nimbusctx.gt4_0.gar.etc.dir}/other/main.xml"
+ file="${nimbusctx.gt4_0.gar.etc.dir}/other/standalone-main.xml" />
+ <echo>Broker context: standalone-main.xml</echo>
+ </target>
+
<!-- *******************************************************************
CREATE DISTRIBUTION
@@ -165,7 +209,14 @@
<delete dir="tmp"/>
</target>
- <target name="dist" depends="disp">
+ <target name="dist-bundled" depends="disp, copy-bundled-main.xml">
+ <echo>Building: ${nimbusctx.gt4_0.gar.print-noun}</echo>
+ <antcall target="_dist" />
+ <echo>Built: ${nimbusctx.gt4_0.gar.print-noun}
+ </echo>
+ </target>
+
+ <target name="dist-standalone" depends="disp, copy_libraries, copy-standalone-main.xml">
<echo>Building: ${nimbusctx.gt4_0.gar.print-noun}</echo>
<antcall target="_dist" />
<echo>Built: ${nimbusctx.gt4_0.gar.print-noun}
@@ -264,4 +315,3 @@ Did you build?
</target>
</project>
-
@@ -3,14 +3,11 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
- xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="
-http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-http://www.springframework.org/schema/aop
-http://www.springframework.org/schema/aop/spring-aop.xsd
-http://www.springframework.org/schema/security
+http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd">
@@ -93,7 +90,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
<!--
property sources are concentrated in this file
-->
- <import resource="main.conflocator.xml"/>
+ <import resource="bundled-main.conflocator.xml"/>
</beans>
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+ xmlns:security="http://www.springframework.org/schema/security"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+http://www.springframework.org/schema/security
+http://www.springframework.org/schema/security/spring-security-3.0.xsd
+http://cxf.apache.org/jaxrs
+http://cxf.apache.org/schemas/jaxrs.xsd">
+
+ <import resource="classpath:META-INF/cxf/cxf.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
+
+ <bean id="userDetailsService" class="org.nimbustools.querygeneral.security.FileUserDetailsService">
+ <constructor-arg value="$NIMBUS_HOME/services/etc/nimbus-context-broker/user-mapfile"/>
+ </bean>
+
+ <jaxrs:server id="ContextBroker" address="/ContextBroker/">
+ <jaxrs:serviceBeans>
+ <ref bean="brokerResource" />
+ </jaxrs:serviceBeans>
+ <jaxrs:outFaultInterceptors>
+ <ref bean="outFaultInterceptor"/>
+ </jaxrs:outFaultInterceptors>
+ <jaxrs:properties>
+ <entry key="org.apache.cxf.propogate.exception" value="false"/>
+ </jaxrs:properties>
+ </jaxrs:server>
+
+ <bean id="brokerResource" class="org.nimbustools.ctxbroker.rest.BrokerResource"/>
+
+ <bean id="basicAuthenticationFilter"
+ class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
+
+ <property name="authenticationManager" ref="authenticationManager"/>
+ <property name="authenticationEntryPoint" ref="authenticationEntryPoint"/>
+ </bean>
+
+ <security:authentication-manager alias="authenticationManager">
+ <security:authentication-provider user-service-ref="userDetailsService"/>
+ </security:authentication-manager>
+
+ <bean id="authenticationEntryPoint"
+ class="org.nimbustools.ctxbroker.rest.FailAuthenticationEntryPoint">
+ <property name="responseUtil" ref="responseUtil"/>
+ </bean>
+
+ <bean name="outFaultInterceptor" class="org.nimbustools.ctxbroker.rest.OutFaultInterceptor">
+ <property name="responseUtil" ref="responseUtil"/>
+ </bean>
+
+ <bean id="responseUtil" class="org.nimbustools.ctxbroker.rest.ResponseUtil"/>
+
+ <security:http auto-config="false" create-session="never" entry-point-ref="authenticationEntryPoint" >
+ <security:custom-filter ref="basicAuthenticationFilter" position="BASIC_AUTH_FILTER" />
+ <security:intercept-url pattern="/**" access="ROLE_USER"/>
+ <security:access-denied-handler ref="accessDeniedHandler"/>
+ </security:http>
+
+ <bean id="accessDeniedHandler" class="org.nimbustools.ctxbroker.rest.FailAccessDeniedHandler">
+ <property name="responseUtil" ref="responseUtil"/>
+ </bean>
+
+</beans>
+
No changes.
@@ -17,7 +17,6 @@
import org.nimbustools.ctxbroker.blackboard.NodeStatus;
-import java.util.ArrayList;
import java.util.List;
public class ContextStatus {
@@ -24,7 +24,6 @@
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.FilterHolder;
import org.mortbay.jetty.servlet.ServletHolder;
-import org.mortbay.jetty.webapp.WebAppContext;
import org.nimbustools.api.brain.NimbusXmlWebApplicationContext;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.filter.DelegatingFilterProxy;
@@ -141,4 +140,4 @@ public Server getServer() {
return server;
}
-}
+}
@@ -39,6 +39,7 @@
******************************************************************* -->
<target name="disp">
+ <echo message="" />
<echo message="**** Module: ${basedir}" />
</target>

0 comments on commit b4def17

Please sign in to comment.