-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The concurrency issues could not be resolved by using the Index page …
…directly. There seems to be a synchronization method for all persistent properties added to the bytecode of the Tapestry classes. Next try: A data service handling this with custom synchronization.
- Loading branch information
Showing
10 changed files
with
119 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 41 additions & 48 deletions
89
gepi/gepi-webapp/src/main/java/de/julielab/gepi/webapp/components/GepiWidget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,53 @@ | ||
package de.julielab.gepi.webapp.components; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import de.julielab.gepi.core.retrieval.data.AggregatedEventsRetrievalResult; | ||
import de.julielab.gepi.core.retrieval.data.EventRetrievalResult; | ||
import de.julielab.gepi.webapp.pages.Index; | ||
import org.apache.tapestry5.BindingConstants; | ||
import org.apache.tapestry5.annotations.InjectComponent; | ||
import org.apache.tapestry5.annotations.InjectPage; | ||
import org.apache.tapestry5.annotations.Parameter; | ||
import org.apache.tapestry5.annotations.Persist; | ||
import org.apache.tapestry5.annotations.Property; | ||
import org.apache.tapestry5.ioc.annotations.Inject; | ||
import org.slf4j.Logger; | ||
|
||
import de.julielab.gepi.core.retrieval.data.EventRetrievalResult; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class GepiWidget { | ||
|
||
@Parameter(defaultPrefix = BindingConstants.LITERAL, name = "class") | ||
@Property | ||
private String classes; | ||
|
||
/** | ||
* For loading state display | ||
*/ | ||
@Parameter | ||
@Property | ||
private CompletableFuture<EventRetrievalResult> esResult; | ||
|
||
/** | ||
* For loading state display | ||
*/ | ||
@Parameter | ||
@Property | ||
private CompletableFuture<AggregatedEventsRetrievalResult> neo4jResult; | ||
|
||
/** | ||
* For loading state display | ||
*/ | ||
@Property | ||
@Persist | ||
protected CompletableFuture<EventRetrievalResult> persistEsResult; | ||
|
||
/** | ||
* For loading state display | ||
*/ | ||
@Property | ||
@Persist | ||
protected CompletableFuture<AggregatedEventsRetrievalResult> persistNeo4jResult; | ||
|
||
@InjectComponent | ||
private GepiWidgetLayout gepiWidgetLayout; | ||
|
||
void setupRender() { | ||
persistEsResult = esResult; | ||
persistNeo4jResult = neo4jResult; | ||
} | ||
|
||
public boolean isLargeView() { | ||
final GepiWidgetLayout.ViewMode mode = gepiWidgetLayout.viewMode(); | ||
return mode == GepiWidgetLayout.ViewMode.LARGE || mode == GepiWidgetLayout.ViewMode.FULLSCREEN; | ||
} | ||
@Inject | ||
private Logger log; | ||
|
||
@Parameter(defaultPrefix = BindingConstants.LITERAL, name = "class") | ||
@Property | ||
private String classes; | ||
|
||
@InjectComponent | ||
private GepiWidgetLayout gepiWidgetLayout; | ||
|
||
@InjectPage | ||
private Index index; | ||
|
||
public CompletableFuture<EventRetrievalResult> getEsResult() { | ||
try { | ||
log.debug("Trying to access index for ES result."); | ||
return index.getEsResult(); | ||
} finally { | ||
log.debug("Retrieved ES result."); | ||
} | ||
} | ||
|
||
public CompletableFuture<AggregatedEventsRetrievalResult> getNeo4jResult() { | ||
try { | ||
log.debug("Trying to access index for Neo4j result."); | ||
return index.getNeo4jResult(); | ||
} finally { | ||
log.debug("Retrieved Neo4j result."); | ||
} | ||
} | ||
|
||
public boolean isLargeView() { | ||
final GepiWidgetLayout.ViewMode mode = gepiWidgetLayout.viewMode(); | ||
return mode == GepiWidgetLayout.ViewMode.LARGE || mode == GepiWidgetLayout.ViewMode.FULLSCREEN; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.