2

How do you get a reference to the current ActivePivotManger? I've found code that uses it but no way to actually get ahold of it.

Burton Samograd
  • 3,652
  • 19
  • 21

1 Answers1

1

If you look at the class SandboxConfig in last v4.4.x you'll see that this class is annotated as following:

@PropertySource(value="classpath:sandbox.properties")
@Configuration
@Import(value={
        ActivePivotConfig.class,
        ActivePivotServicesConfig.class,
        WebServicesConfig.class,
        RemotingConfig.class,
        SecurityConfig.class
})
public class SandboxConfig {

The ActivePivotConfig.class in the annotation is the one in which we define the activePivotManager which is defined as a member of the SandboxConfig class:

    /** ActivePivot Manager, automatically wired */
   @Autowired
    protected IActivePivotManager activePivotManager;

The @Autowired here is important as it means that this is provided already.

in the previous versions of AP we were defining this as following in our project:

<!-- ActivePivot Manager -->
    <bean id="ActivePivotManager" class="com.quartetfs.biz.pivot.impl.ActivePivotManagerFactory">
        <property name="resourceName" value="DESC-INF/ActivePivotManager.xml" />
        <property name="autoStart" value="false" />
        <property name="healthCheckPeriod" value="120"/>
    </bean>

If you want to use the ActivePivotManager instance stick then to what is in the SandboxConfig and add your logic there, use the ActivePivotManager instance defined there.

If you're not happy with that move to full XML wiring which is still supported as I can understand that some stuff is hidden and you expect to see the instance of ActivePivotManager instantiated clearly somewhere (which is done actually in ActivePivotConfig.class).

tuxmobil
  • 238
  • 3
  • 10
  • We are currently using AP 4.3.5. I found the @Autowired example but could not back port it due to missing quartet import classes and 'import static com.quartetfs.fwk.types.impl.ExtendedPluginInjector.inject;' so I could not get it to work. Also, when I try to import com.quartetfs.biz.pivot.spring.ActivePivotConfig it does not exist; do I need to specifiy another quartet maven dependency to add this package to my project? – Burton Samograd Apr 24 '13 at 13:40
  • if you're using 4.3.5 forget about the @Autowired, this wiring logic exists since 4.4.x. This explains why you re missing some imports – tuxmobil Apr 25 '13 at 02:16
  • It turns out I lacked experience with Spring and how it worked. A collegue showed me how to to dependency injection that worked with ouur AP version and it all worked out. – Burton Samograd May 02 '13 at 08:23