Subversion Repository Public Repository

litesoft

Diff Revisions 49 vs 60 for /trunk/Java/GWT/OldServer/src/org/litesoft/GWT/forms/server/support/nonpublic/AbstractFormServicePeer.java

Diff revisions: vs.
  @@ -12,7 +12,6 @@
12 12 import org.litesoft.core.simpletypes.*;
13 13 import org.litesoft.delayed.*;
14 14 import org.litesoft.exceptions.*;
15 - import org.litesoft.rpcpassable.*;
16 15 import org.litesoft.ui.def.*;
17 16 import org.litesoft.ui.def.nonpublic.support.*;
18 17 import org.litesoft.ui.support.*;
  @@ -28,7 +27,7 @@
28 27
29 28 protected volatile PushInterface mPushInterface = null;
30 29 protected ISystemUserResolver mSystemUserResolver = ISystemUserResolver.NULL;
31 - protected RPCpassable mInitializationPayload;
30 + protected Serializable mInitializationPayload;
32 31 protected volatile boolean mIsNewRootObject;
33 32
34 33 private volatile boolean mDisposed = false;
  @@ -62,14 +61,12 @@
62 61
63 62 if ( zOldData.isPublishable() )
64 63 {
65 - ChangeListenerManager.removeListener( this );
64 + // todo: Need Instance of: ChangeListenerManager.removeListener( this );
66 65 publish( zOldData, ServerStateChange.Action.DELETED );
67 66 }
68 67 if ( zNewData.isPublishable() )
69 68 {
70 - ChangeListenerManager.addListener( this, //
71 - "FSP:" + zNewData.getRootType(), //
72 - (Serializable) zNewData.getRootObjectKey() );
69 + // todo: Need Instance of: ChangeListenerManager.addListener( this, "FSP:" + zNewData.getRootType(), (Serializable) zNewData.getRootObjectKey() );
73 70 publish( zNewData, ServerStateChange.Action.CREATED );
74 71 }
75 72
  @@ -84,18 +81,16 @@
84 81
85 82 private void publish( FormInteractionStructure pData, ServerStateChange.Action pAction )
86 83 {
87 - ServerStateChange zChange = new ServerStateChange( pAction, "FSP:" + pData.getRootType(),
88 - pData.getRootObjectKey(), null, pData );
84 + ServerStateChange zChange = new ServerStateChange( pAction, "FSP:" + pData.getRootType(), pData.getRootObjectKey(), null, pData );
89 85 Long zSourceUniqueID = pData.getUniqueFormServicePeerID();
90 86 ServerStateChangeSet zChangeSet = new ServerStateChangeSet( zSourceUniqueID, null, zChange );
91 - ChangeListenerManager.notifyAllListeners( zChangeSet );
87 + // todo: Need Instance of: ChangeListenerManager.notifyAllListeners( zChangeSet );
92 88 }
93 89
94 90 public void serverStateChanged( ServerStateChangeSet pServerStateChangeSet )
95 91 {
96 92 // event order?
97 - FormInteractionIntersection zFII =
98 - mInteractionHelper.createFormInteractionIntersection( pServerStateChangeSet );
93 + FormInteractionIntersection zFII = mInteractionHelper.createFormInteractionIntersection( pServerStateChangeSet );
99 94 if ( zFII.getData().isPublishable() )
100 95 {
101 96 if ( zFII.isNewOthers() )
  @@ -233,9 +228,7 @@
233 228 PushInterface zPushInterface = mPushInterface;
234 229 if ( zPushInterface != null )
235 230 {
236 - ServicePeerToFormData zData = getCollectorProxy().createReturnValueFromCollectorIfMatches( null,
237 - mInteractionHelper,
238 - getRootTypeExternalizationInterface() );
231 + ServicePeerToFormData zData = getCollectorProxy().createReturnValueFromCollectorIfMatches( null, mInteractionHelper, getRootTypeExternalizationInterface() );
239 232 if ( zData != null )
240 233 {
241 234 zPushInterface.sendUnsolicitedData( zData );
  @@ -244,11 +237,7 @@
244 237 }
245 238
246 239 // protects serializes FormServicePeer interface
247 - public synchronized final ServicePeerToFormCreationData initializeAndCreateFormMetaData(
248 - PushInterface pPushInterface, ISystemUserResolver pSystemUserResolver,
249 - Long pUniqueFormServicePeerID, ISystemUser pSystemUser, FormUsage pUsage,
250 - RPCpassable pInitializationPayload, ExternalizationInterface pExternalization,
251 - FormAccessControl pAccessControl )
240 + public synchronized final ServicePeerToFormCreationData initializeAndCreateFormMetaData( PushInterface pPushInterface, ISystemUserResolver pSystemUserResolver, Long pUniqueFormServicePeerID, ISystemUser pSystemUser, FormUsage pUsage, Serializable pInitializationPayload, ExternalizationInterface pExternalization, FormAccessControl pAccessControl )
252 241 {
253 242 mPushInterface = pPushInterface;
254 243
  @@ -258,13 +247,11 @@
258 247
259 248 mSystemUserResolver = (pSystemUserResolver != null) ? pSystemUserResolver : ISystemUserResolver.NULL;
260 249
261 - handle( mInteractionHelper.setOurData(
262 - new FormInteractionStructure( pUniqueFormServicePeerID, pSystemUser, zRT ) ) );
250 + handle( mInteractionHelper.setOurData( new FormInteractionStructure( pUniqueFormServicePeerID, pSystemUser, zRT ) ) );
263 251
264 252 LOGGER.trace.log( zRT, "-initializeAndCreateFormMetaData:", getUniqueFormID(), " for ", pSystemUser );
265 253
266 - TypeHelper zRootTypeHelper =
267 - createTypeHelper( this, augment( pExternalization ), pAccessControl, null, zRT, pUsage );
254 + TypeHelper zRootTypeHelper = createTypeHelper( this, augment( pExternalization ), pAccessControl, null, zRT, pUsage );
268 255
269 256 mTypeHelperManager.setRootTypeHelper( zRootTypeHelper );
270 257 mInstanceHelperManager.setRootInstanceHelper( createRootInstanceHelper( zRootTypeHelper ) );
  @@ -323,8 +310,7 @@
323 310 }
324 311
325 312 // protects serializes FormServicePeer interface
326 - public synchronized final ServicePeerToFormData setRootObjectTo( Integer pAsyncMessageNumber,
327 - String pKey )
313 + public synchronized final ServicePeerToFormData setRootObjectTo( Integer pAsyncMessageNumber, String pKey )
328 314 {
329 315 LOGGER.trace.log( getRootType(), "-setRootObjectTo, key:", pKey );
330 316
  @@ -336,17 +322,13 @@
336 322
337 323 mInstanceHelperManager.loadAllAttributeValues();
338 324
339 - return getCollectorProxy().createReturnValueFromCollectorIfMatches( pAsyncMessageNumber,
340 - mInteractionHelper,
341 - getRootTypeExternalizationInterface() );
325 + return getCollectorProxy().createReturnValueFromCollectorIfMatches( pAsyncMessageNumber, mInteractionHelper, getRootTypeExternalizationInterface() );
342 326 }
343 327
344 328 // protects serializes FormServicePeer interface
345 - public synchronized final AttributeResourceOptionsResponseData getResourceOptions(
346 - AttributeResourceOptionsRequestData pRequest )
329 + public synchronized final AttributeResourceOptionsResponseData getResourceOptions( AttributeResourceOptionsRequestData pRequest )
347 330 {
348 - return getResourceOptions( pRequest.getFormDataRowKey(), pRequest.getUniqueID(),
349 - pRequest.getAttributeReference() );
331 + return getResourceOptions( pRequest.getFormDataRowKey(), pRequest.getUniqueID(), pRequest.getAttributeReference() );
350 332 }
351 333
352 334 // protects serializes FormServicePeer interface
  @@ -364,26 +346,20 @@
364 346 for ( ValueUpdatedFormData update : zValueUpdates )
365 347 {
366 348 processValueUpdated( update.getFormDataRowKey(), //
367 - update.getUniqueID(), update.getAttributeReference(),
368 - update.getCurrentValue() );
349 + update.getUniqueID(), update.getAttributeReference(), update.getCurrentValue() );
369 350 }
370 351 }
371 352
372 353 ActionRequestFormData action = pToServicePeerData.getActionRequest();
373 354 if ( action != null )
374 355 {
375 - processActionRequest( action.getFormDataRowKey(), action.getActionID(), action.isInputAction(),
376 - action.getParentFormDataRowKey() );
356 + processActionRequest( action.getFormDataRowKey(), action.getActionID(), action.isInputAction(), action.getParentFormDataRowKey() );
377 357 }
378 358
379 - return getCollectorProxy().createReturnValueFromCollectorIfMatches( zAsyncMessageNumber,
380 - mInteractionHelper,
381 - getRootTypeExternalizationInterface() );
359 + return getCollectorProxy().createReturnValueFromCollectorIfMatches( zAsyncMessageNumber, mInteractionHelper, getRootTypeExternalizationInterface() );
382 360 }
383 361
384 - protected AttributeResourceOptionsResponseData getResourceOptions( FormDataRowKey pFormDataRowKey,
385 - Integer pUniqueID,
386 - String pAttributeReference )
362 + protected AttributeResourceOptionsResponseData getResourceOptions( FormDataRowKey pFormDataRowKey, Integer pUniqueID, String pAttributeReference )
387 363 {
388 364 InstanceHelper zInstanceHelper = getInstanceHelper( pFormDataRowKey );
389 365 if ( (zInstanceHelper != null) )
  @@ -391,8 +367,7 @@
391 367 AMDconverterPair changingPair = zInstanceHelper.findAttribute( pUniqueID );
392 368 if ( changingPair != null )
393 369 {
394 - return zInstanceHelper.getTypeHelper().getResourceOptions( pAttributeReference,
395 - changingPair.getDataConverter() );
370 + return zInstanceHelper.getTypeHelper().getResourceOptions( pAttributeReference, changingPair.getDataConverter() );
396 371 }
397 372 }
398 373 return new AttributeResourceOptionsResponseData( ResourceOptionsErrorType.ErrorReferenceNotFound );
  @@ -400,15 +375,13 @@
400 375
401 376 private void processValueUpdated( FormDataRowKey pFormDataRowKey, //
402 377 Integer pUniqueID, String pAttributeReference, //
403 - RPCpassable pNewValue )
378 + Serializable pNewValue )
404 379 {
405 380 //System.out.println( getRootType() + "-valueUpdated on (" + pFormDataRowKey + ") '" +
406 381 // pAttributeReference + "' to '" + pNewValue + "' type:" +
407 382 // ((pNewValue != null) ? pNewValue.getClass() : null) );
408 383 //
409 - LOGGER.trace.log( getRootType(), "-valueUpdated on (", pFormDataRowKey, ") '", pAttributeReference,
410 - "' to '", pNewValue, "' type:",
411 - ((pNewValue != null) ? pNewValue.getClass() : null) );
384 + LOGGER.trace.log( getRootType(), "-valueUpdated on (", pFormDataRowKey, ") '", pAttributeReference, "' to '", pNewValue, "' type:", ((pNewValue != null) ? pNewValue.getClass() : null) );
412 385
413 386 String zResolvedError = null;
414 387 AMDconverterPair changingPair = null;
  @@ -430,8 +403,7 @@
430 403 if ( !handled && !hasErrors() )
431 404 {
432 405 InstanceHelper zInstanceHelper = getInstanceHelper( pFormDataRowKey );
433 - if ( (zInstanceHelper == null) ||
434 - (null == (changingPair = zInstanceHelper.findAttribute( pUniqueID ))) )
406 + if ( (zInstanceHelper == null) || (null == (changingPair = zInstanceHelper.findAttribute( pUniqueID ))) )
435 407 {
436 408 addError( ERR_ATTR_NOT_FOUND );
437 409 }
  @@ -454,8 +426,7 @@
454 426 {
455 427 try
456 428 {
457 - if ( !(handled =
458 - LLvalueUpdated( zInstanceHelper, pAttributeReference, zValueForAttribute )) )
429 + if ( !(handled = LLvalueUpdated( zInstanceHelper, pAttributeReference, zValueForAttribute )) )
459 430 {
460 431 zResolvedError = rootTypeResolveError( ERR_VALUE_UPDATE_NOT_HANDLED );
461 432 }
  @@ -481,17 +452,14 @@
481 452 }
482 453 }
483 454
484 - protected boolean LLvalueUpdated( InstanceHelper pInstanceHelper, String pAttributeReference,
485 - Object pValueForAttribute )
455 + protected boolean LLvalueUpdated( InstanceHelper pInstanceHelper, String pAttributeReference, Object pValueForAttribute )
486 456 {
487 457 return pInstanceHelper.valueUpdated( pAttributeReference, pValueForAttribute );
488 458 }
489 459
490 - private void processActionRequest( FormDataRowKey pFormDataRowKey, String pActionID, boolean pInputAction,
491 - FormDataRowKey pParentFormDataRowKey )
460 + private void processActionRequest( FormDataRowKey pFormDataRowKey, String pActionID, boolean pInputAction, FormDataRowKey pParentFormDataRowKey )
492 461 {
493 - LOGGER.trace.log( getRootType(), "-actionRequest, ", (pInputAction ? "Input" : "Reg"), " action:",
494 - pActionID );
462 + LOGGER.trace.log( getRootType(), "-actionRequest, ", (pInputAction ? "Input" : "Reg"), " action:", pActionID );
495 463
496 464 if ( actionRequest( pFormDataRowKey, pActionID, pInputAction, pParentFormDataRowKey ) )
497 465 {
  @@ -507,8 +475,7 @@
507 475 }
508 476 }
509 477
510 - protected void checkForChanges( AMDconverterPair pChangingPair, RPCpassable pNewValue,
511 - String pResolvedError )
478 + protected void checkForChanges( AMDconverterPair pChangingPair, Serializable pNewValue, String pResolvedError )
512 479 {
513 480 // Snag a list to avoid Concurrent Changes
514 481 InstanceHelpersSnapShot zSnapShot = mInstanceHelperManager.getInstanceHelpers();
  @@ -523,8 +490,7 @@
523 490 }
524 491 }
525 492
526 - public boolean actionRequest( FormDataRowKey pFormDataRowKey, String pActionID, boolean pInputAction,
527 - FormDataRowKey pParentFormDataRowKey )
493 + public boolean actionRequest( FormDataRowKey pFormDataRowKey, String pActionID, boolean pInputAction, FormDataRowKey pParentFormDataRowKey )
528 494 {
529 495 if ( UiFormDef.ACTION_CLOSE.equals( pActionID ) )
530 496 {
  @@ -553,8 +519,7 @@
553 519 }
554 520 TypeHelper zTypeHelper = getTypeHelper( pFormDataRowKey );
555 521 return (zTypeHelper != null) && //
556 - zTypeHelper.actionRequest( pActionID, pInputAction,
557 - getInstanceHelper( pParentFormDataRowKey ) );
522 + zTypeHelper.actionRequest( pActionID, pInputAction, getInstanceHelper( pParentFormDataRowKey ) );
558 523 }
559 524
560 525 public ArrayList<FormDataRowKey> getAllCurrentFormDataRowKeys()
  @@ -735,13 +700,12 @@
735 700 /**
736 701 * @return true to indicate processing satisfied
737 702 */
738 - protected boolean LLrawValueUpdated( FormDataRowKey pFormDataRowKey, String pAttributeReference,
739 - RPCpassable pNewValue )
703 + protected boolean LLrawValueUpdated( FormDataRowKey pFormDataRowKey, String pAttributeReference, Serializable pNewValue )
740 704 {
741 705 return false;
742 706 }
743 707
744 - protected void initializationPayloadAvailable( RPCpassable pInitializationPayload )
708 + protected void initializationPayloadAvailable( Serializable pInitializationPayload )
745 709 {
746 710 }
747 711
  @@ -755,7 +719,7 @@
755 719 return new InterceptingProxyExternalization( pExternalizationInterface );
756 720 }
757 721
758 - protected RPCpassable getFormRenderedServicePeerXtra()
722 + protected Serializable getFormRenderedServicePeerXtra()
759 723 {
760 724 return null;
761 725 }