Hello Alexandre
Thank you for your answer ,
I will prefer to keep persistance since server restart will cause less
trouble for clients ( registration will not be deleted for all but
only for those that tried
to re-register in time of restart ).
I am setting the timer in following way :
NullActivity nullActivity = nullActivityFactory.createNullActivity();
ActivityContextInterface nullActivityContextInterface =
nullACIFactory.getActivityContextInterface(nullActivity);
nullActivityContextInterface.attach(this.getSbbContext().getSbbLocalObject());
TimerOptions options = new TimerOptions();
options.setPreserveMissed(TimerPreserveMissed.ALL);
this.timerFacility.setTimer(nullActivityContextInterface, null,
System.currentTimeMillis() + expires*1000 + 100, options);
and doing the following in timer event :
public void onTIMER(javax.slee.facilities.TimerEvent event,
ActivityContextInterface aci)
{
ProfileTable profileTable = null;
try
{
profileTable=profileFacility.getProfileTable(profileTableName);
//check if exists in storage
ProfileLocalObject profileLocalObject =
profileTable.find(getProfileNameCMP());
if(profileLocalObject!=null)
{
if(((RegistrarProxyProfileCMP)profileLocalObject).getValidTill().before(new
Date()))
{
tracer.info("Registration expired for " + getProfileNameCMP());
profileTable.remove(getProfileNameCMP());
}
}
}
catch (UnrecognizedProfileTableNameException e)
{
}
aci.detach(this.getSbbContext().getSbbLocalObject());
}
But there are several problems in this case.
First of all the timer is set on null acivity , and this activity will
not exist after the restart , also sbb entity attached to null
activity will not?
Also i store the profile name in CMP field , that will not be
available.
So to make it persistant and working i need not only the timer events
be persistant , but also sbb entitites and activities.
Best regards
Yulian Oifa
On Apr 21, 4:56 pm, Alexandre Mendonça <
brains...@gmail.com> wrote:
> Hi Yulian,
>
> You have two options:
>
> 1) Disable profile persistence, by editing
> ./mobicents-slee/META-INF/jboss-beans.xml:
>
> <bean name="Mobicents.JAINSLEE.Profiles.JPA.HSQLDBConfig"
> class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
> <property name="persistProfiles">*false*</property>
> ...
> </bean>
>
> - OR -
>
> 2) At service start you can clear all the profiles (using findAll() +
> remove(name)) or simply remove and recreate the table, it should come up
> clean.
>
> As a side note, at JAIN SLEE 1.0 there was the option to have persistent
> timers, that would survive server restarts..In JAIN SLEE 1.1 it was
> deprecated but I think it still works... if you use that together with the
> proper Preserve Missed option (ALL), you may get your timers fired once SLEE
> restarts.
>
> Hope it helps.
>
> Regards,
>
> --
> *Alexandre Mendonça* // JBoss R&Dhttp://
ammendonca.blogspot.com/