Skip to main content

Home/ SoftwareEngineering/ Group items tagged events

Rss Feed Group items tagged

kuni katsuya

Enterprise JavaBeans 3.1 with Contexts and Dependency Injection: The Perfect Synergy - 0 views

  • stateless EJB 3.1 bean as boundary (Facade)
  • injected managed beans (controls)
  • @Inject
  • ...22 more annotations...
  • @Inject
  • CDI managed beans. The @EJB annotation is removed and @Inject is used instead
  • Annotating the boundary (Cart) with the @Named annotation makes the Cart immediately visible for expression language (EL) expressions in JSP and JSF
  • @Named annotation takes the simple name of the annotated class, puts the first character in lowercase, and exposes it directly to the JSF pages (or JSP). The Cart bean can be accessed directly, without any backed or managed beans, by the JSF pages: <h:commandButton value="Check out!" action="#{cart.checkout}" />
  • If there is a need for abstraction, the class can be turned into an interface (or abstract class)
  • local implementation (with CDI events
  • @Inject Event<String> event;
  • event.fire("Order proceeded!");
  • remote implementation:
  • javax.enterprise.event.Event belongs to the CDI-implementation
  • class Event can be considered to be a lightweight alternative to the java.beans.PropertyChangeSupport class
  • @Inject Event<String> event;
  • event.fire("Order proceeded!");
  • event can be received by any managed bean and also by EJB beans
  • provide a method with a single @Observes annotated parameter
  • @Observes String event
  • there is no real event, just the payload:
  • The during attribute in the @Observes annotation allows you to select in which transactional phase the event gets delivered. The default setting is IN_PROGRESS, which causes an immediate event delivery regardless of the transaction outcome. The AFTER_SUCCESS configuration causes the delivery to occur only after successful transaction completion
  • Although CDI events work only inside a single process (in the default case, CDI is extensible), they are perfectly suitable for decoupling packages from modules
  • The method checkout() starts a transaction that gets "reused" by the OrderSystem and CustomerNotification session beans
  • ordering.placeOrder(); notifier.sendNotification();
    • kuni katsuya
       
      both run within same transaction
  • EJB beans cannot be directly exposed to JSF or JSP without a little help from CDI
kuni katsuya

Logging Cheat Sheet - OWASP - 0 views

  • Legal and other opt-ins
    • kuni katsuya
       
      terms & conditions acceptance, license transfers, etc
  • Data changes
    • kuni katsuya
       
      all changes to domain objects
  • Event attributes
  • ...35 more annotations...
  • Log date and time
  • Event date and time
  • Application identifier
    • kuni katsuya
       
      eg. service type
  • Application address
    • kuni katsuya
       
      eg. service instance
  • User identity
    • kuni katsuya
       
      ie. subject
  • Type of event
  • Severity of event
  • Description
    • kuni katsuya
       
      eg. event message text
  • Action
    • kuni katsuya
       
      eg. action performed on managed resource (eg. 'update' action on resource 'hotel')
  • original intended purpose of the request
  • Object
    • kuni katsuya
       
      eg. managed resource being accessed
  • affected component
  • Result status
    • kuni katsuya
       
      boolean was_successful
  • Reason
    • kuni katsuya
       
      include in event message text
  • Extended details
  • Data to exclude
  • Access tokens
  • Session identification values
  • Sensitive personal data
  • passwords
  • Database connection strings
  • Encryption keys
  • payment
  • Information a user has opted out of collection
  • Synchronize time across all servers and devices
  • Input validation failures
  • Which events to log
  • proportional to the information security risks
  • Always log:
  • Authentication successes and failures
  • Authorization failures
  • Session management failures
  • Application errors and system events
  • Application and related systems start-ups and shut-downs
  • Use of higher-risk functionality
kuni katsuya

Java Persistence/Advanced Topics - Wikibooks, open books for an open world - 0 views

  • Events
  • hook into a system that allows the execution of some code when the event occurs
  • JPA defines several events for the persistent
  • ...37 more annotations...
  • life-cycle
  • of Entity objects
  • JPA defines the following events:
  • PostLoad
  • PrePersist
  • PostPersist
  • PreUpdate
  • PostUpdate
  • PreRemove
  • PostRemove
  • after an Entity is loaded into the
  • persistence context
  • before the persist operation is invoked on an Entity
  • after a refresh operation.
  • before the remove operation is invoked on an Entity
  • cascade of a remove operation
  • during a flush or commit for orphanRemoval in JPA 2.0
  • after an instance is deleted from the database
  • occurs during a flush or commit operation
  • after the database DELETE has occurred
  • before the transaction is committed
  • after an instance is updated in the database
  • occurs during a flush or commit operation
  • after the database UPDATE has occurred
  • before the transaction is committed
  • before an instance is updated in the database
  • occurs during a flush or commit operation
  • after the database UPDATE has occurred
  • before the transaction is committed
  • after a new instance is persisted to the database
  • occurs during a flush or commit operation
  • after the database INSERT has occurred
  • before the transaction is committed
  • Id of the object should be assigned
  • merge for new instances
  • cascade of a persist operation
  • Id of the object may not have been assigned, and code be assigned by the event
kuni katsuya

Working with Events in CDI - NetBeans IDE Tutorial - 0 views

kuni katsuya

JBoss Seam 3 JMS Module - 0 views

  • Bridging the Gap
  • Routing CDI Events to JMS
  • CDI Events from JMS Messages
  •  
    "Event Routing"
kuni katsuya

Auditing Entities With JPA Events | Andy Gibson - 0 views

  • Auditing Entities With JPA Events
  • An alternative is if you are using a generic DAO class to handle entity persistence is to put the enhanced populateTimestamp method on there and call it prior to inserting or updating the entity in the DAO
kuni katsuya

JBoss Developer Framework - 0 views

  • jta-crash-rec Crash Recovery, JTA Uses Java Transaction API and JBoss Transactions to demonstrate recovery of a crashed transaction
  • jts-distributed-crash-rec JTS Demonstrates recovery of distributed crashed components
  • cdi-injection CDI Demonstrates the use of CDI 1.0 Injection and Qualifiers with JSF as the front-end client.
  • ...13 more annotations...
  • bean-validation JPA, Bean Validation Shows how to use Arquillian to test Bean Validation
  • ejb-security Security, EJB Shows how to use Java EE Declarative Security to Control Access to EJB 3
  • payment-cdi-event CDI Demonstrates how to use CDI 1.0 Events
  • richfaces-validation RichFaces Demonstrates RichFaces and bean validation
  • ejb-in-war JSF, WAR, EJB Packages an EJB JAR in a WAR
  • greeter EJB, JPA, JSF, JTA, CDI Demonstrates the use of CDI 1.0, JPA 2.0, JTA 1.1, EJB 3.1 and JSF 2.0
  • helloworld-mdb EJB, MDB, JMS Demonstrates the use of JMS 1.1 and EJB 3.1 Message-Driven Bean
  • helloworld-rs JAX-RS, CDI Demonstrates the use of CDI 1.0 and JAX-RS
  • kitchensink BV, EJB, JAX-RS, JPA, JPA, JSF, CDI
  • servlet-async CDI, EJB, Servlet Demonstrates CDI, plus asynchronous Servlets and EJBs
  • servlet-security Security, Servlet Demonstrates how to use Java EE declarative security to control access to Servlet 3
  • shopping-cart EJB Demonstrates a stateful session bean
  • tasks Arquillian, JPA Demonstrates testing JPA using Arquillian
kuni katsuya

Plummer's Mind: GraniteDS Tutorial: Intro to The Tide Client Framework - 0 views

  • GraniteDS Tutorial: Intro to The Tide Client Framework
  • only one per Application
  • Tide Context
  • ...2 more annotations...
  • Tide will automatically inject shared data and correctly route events without requiring the application developer to write their own mechanism for sharing information or explicitly registering event listeners
  • Tide events are a simplification on the already existing Flex event framework
kuni katsuya

Session Management | Apache Shiro - 0 views

  • available in any application,
  • regardless of container.
  • even if you deploy your application in a Servlet or EJB container, there are still compelling reasons to use Shiro's Session support instead of the container's
  • ...40 more annotations...
  • Easy Custom Session Storage
  • POJO/J2SE based (IoC friendly)
  • Container-Independent Clustering!
  • Heterogeneous Client Access
  • Event Listeners
  • listen to lifecycle events during a session's lifetime
  • Host Address Retention
  • retain the IP address or host name of the host from where the session was initiated
  • Inactivity/Expiration Support
  • can be prolonged via a touch() method to keep them 'alive' if desired
  • Transparent Web Use
  • can use Shiro sessions in existing web applications and you
  • don't need to change any of your existing web cod
  • Can be used for SSO
  • easily stored in any data source
  • can be
  • 'shared'
  • across applications if needed
  • 'poor man's SSO'
  • simple sign-on experience since the shared session can retain authentication state
  • interface-based and implemented with POJOs
  • allows you to easily configure all session components with any JavaBeans-compatible configuration format, like JSON, YAML
  • easily extend
  • customize session management functionality
  • session data can be easily stored in any number of data sources
  • easily clustered using any of the readily-available networked caching products
  • no matter what container you deploy to, your sessions will be clustered the same way
  • No need for container-specific configuration!
  • Shiro sessions can be 'shared' across various client technologies
  • listen for these events and react to them for custom application behavior
  • SecurityUtils.getSubject()
  • currentUser.getSession()
  • If the Subject already has a Session, the boolean argument is ignored and the Session is returned immediately
  • If the Subject does not yet have a Session and the create boolean argument is true,
  • a new session will be created
  • and returned.
  • If the Subject does not yet have a Session and the create boolean argument is false, a new session will not be created and null is returned.
  • Suject.getSession(boolean create)
  • method functions the same way as the
  • HttpServletRequest.getSession(boolean create) method:
    • kuni katsuya
kuni katsuya

Security Module Drafts - Apache DeltaSpike - Apache Software Foundation - 0 views

  • Authorization
  • Impersonalization
    • kuni katsuya
       
      impersonation
  • authenticates “as a user” or access application imitating his identity - without knowing his password
  • ...36 more annotations...
  • elements of the user interface are displayed to the user based on the user's privilege level
  • assign permissions to individual objects within the application’s business domain
    • kuni katsuya
       
      individual objects == instances
  • Permissions
  • Permissions assigned to user for a given resource in the tree are inherited by other resources
  • Permissions are inherited
  • persist user, group and role information in database. JPA implementation is his dream
  • Security Module Drafts
  • Identity
  • interface Identity
  • login()
  • logout()
  • getUser()
  • Events LoggedInEvent LoginFailedEvent AlreadyLoggedInEvent PreLoggedOutEvent PostLoggedOutEvent PreAuthenticateEvent PostAuthenticateEvent
  • Object level permission
  • Grant or revoke permissions
  • Group management
  • User/Identity management
  • identity.hasRole
  • identity.hasPermission
  • Permissions model
  • Identity Management (IDM)
  • User, Group and Role
  • Events
  • hooks for common IDM or Security operations
  • Audit and logging for permission and IDM related changes
  • Event API.
  • Impersonalization
  • Impersonalization
  • control which elements of the user interface are displayed to the user based on their assigned permissions
  • ask for permission
  • without need to obtain object from DB
  • String resourceId
  • structure of resources
  • more advanced security resolution mechanisms
  • Rules based engine
  • external services - XACML
kuni katsuya

Oracle Learning Library - Creating and Using Contexts and Dependency Injection (CDI) Ev... - 0 views

  • Creating and Using Contexts and Dependency Injection (CDI) Events
kuni katsuya

Ontology (information science) - Wikipedia, the free encyclopedia - 0 views

  • an ontology formally represents knowledge as a set of concepts within a domain, and the relationships between those concepts. It can be used to reason about the entities within that domain and may be used to describe the domain
  • n ontology renders shared vocabulary and taxonomy which models a domain with the definition of objects and/or concepts and their properties and relations
  • Common components of ontologies include:
  • ...8 more annotations...
  • Individuals: instances or objects
  • Attributes: aspects, properties, features, characteristics, or parameters
  • Relations: ways in which classes and individuals can be related to one another
  • Function terms:
  • Restrictions: formally stated descriptions of what must be true in order for some assertion to be accepted as input
  • Rules: statements in the form of an if-then (antecedent-consequent) sentence that describe the logical inferences that can be drawn from an assertion in a particular form
  • Axioms: assertions (including rules) in a logical form
  • Events: the changing of attributes or relations
kuni katsuya

Chapter 14. Tide client framework - 0 views

  • Tide client framework
  • framework features
  • Dependency Injection
  • ...18 more annotations...
  • Event Bus
  • Contextual Components and Conversations
  • Contexts and Components
  • two main kinds of contexts:
  • global context
  • unique context that exists during the whole lifetime of the Flex application
  • compared to to the server-side session
  • conversation contexts
  • temporary contexts that can be created and destroyed at any time during the lifetime of the application
  • can exist simultaneously
  • isolated from each other
  • Components are stateful objects that can be of any ActionScript 3 class with a default constructor
  • have a name
  • A context is mostly a container for component instances
  • three available scopes:
  • session scope
  • conversation scope
  • event scope
  •  
    "Tide client framework"
kuni katsuya

log4jdbc - JDBC proxy driver for logging SQL and other interesting information. - Googl... - 0 views

  • for prepared statements, the bind arguments are automatically inserted into the SQL output
  • SQL timing information can be generated to help identify how long SQL statements take to run
  • included tool to produce profiling report data for quickly identifying slow SQL in your application
  • ...16 more annotations...
  • SQL connection number information is generated
  • change the driver class name to net.sf.log4jdbc.DriverSpy
  • "jdbc:log4"
  • jdbc.sqlonly
  • jdbc.sqltiming
  • jdbc.audit
  • jdbc.resultset
  • jdbc.connection
  • only SQL
  • the SQL
  • timing statistics
  • ALL JDBC calls
  • very voluminous output
  • all calls to ResultSet objects
  • connection open and close events
  • useful for hunting down connection leak problems
kuni katsuya

Seam Cron Module - 0 views

  • Seam Cron is a CDI portable extension for scheduled and asynchronous method invocation
  • It wraps common scheduling and backgrounding tasks in an intuitive, type-safe, event driven API
  • Seam Cron Module
kuni katsuya

3. Gas3 Code Generator - Confluence - 0 views

  • 3. Gas3 Code Generator
  • Known Limitations
  • Gas3 does not support inner classes
  • ...26 more annotations...
  • except of enum type
    • kuni katsuya
       
      not quite sure what this means...
  • must declare your classes in separated source files if you want them to be correctly handled by the generator
  • Java enums
  • enum.gsp
  • JPA entity beans
  • entity.gsp
  • Java interfaces
  • interface.gsp
  • Java services
  • remote.gsp
  • Java events
  • bean.gsp
  • All other Java classes
  • bean.gsp
  • beanBase.gsp
  • beanBase.gsp
  • remoteBase.gsp, or tideRemoteBase.gsp
  • entityBase.gsp, or tideEntityBase.gsp
  • @Entity
  • @MappedSuperclass
  • @RemoteDestination
  • @TideEvent
  • templates are bundled in the granite-generator.jar
  • accessible as resources via the class loader
  • GraniteDS comes with an ActionScript3 code generator that writes AS3 beans for all externalized JavaBeans, with specific support for lazily loaded EJB 3 entities
  • 3. Gas3 Code Generator
kuni katsuya

Chapter 14. Tide client framework - 0 views

  • 14.3. Contexts and Components
  • core concepts
  • component
  • ...14 more annotations...
  • context
  • unique context that exists during the whole lifetime of the Flex application. It can be compared to to the server-side session
  • Components
  • two main kinds of contexts:
  • stateful objects that can be of any ActionScript 3 class with a default constructor
  • global context
  • temporary contexts that can be created and destroyed at any time during the lifetime of the application
  • conversation contexts
  • conversation context always has an identifier
  • usually tied to a particular use case in the application
  • three available scopes:
  • session scope
  • conversation scope
  • event scope
kuni katsuya

Chapter 14. Tide client framework - 0 views

1 - 20 of 31 Next ›
Showing 20 items per page