Skip to main content

Home/ SoftwareEngineering/ Group items tagged injection

Rss Feed Group items tagged

kuni katsuya

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

  • In JEE the EntityManager or EntityManagerFactory can
  • injected into a SessionBean
  • A managed EntityManager should never be closed, and integrates with JTA transactions
  • ...3 more annotations...
  • Example of injecting an EntityManager and EntityManagerFactory in a SessionBean
  • @Stateless
  • @PersistenceContext(unitName="acme") private EntityManager entityManager;
kuni katsuya

SQL Injection Prevention Cheat Sheet - OWASP - 0 views

  • SQL Injection Prevention Cheat Sheet
  • it is EXTREMELY simple to avoid SQL Injection vulnerabilities in your code.
  • create dynamic database queries that include user supplied input
  • ...19 more annotations...
  • a) stop writing dynamic queries
  • b) prevent user supplied input which contains malicious SQL from affecting the logic of the executed query
  • Primary Defenses:
  • Option #1: Use of Prepared Statements (Parameterized Queries)
  • Option #3: Escaping all User Supplied Input
  • Additional Defenses:
  • Enforce: Least Privilege
    • kuni katsuya
       
      least privilege should be *required*, included as a primary defense
  • Perform: White List Input Validation
  • Primary Defenses
  • Defense Option 1: Prepared Statements (Parameterized Queries)
  • attacker is not able to
  • change the intent
  • of a query, even if SQL commands are inserted by an attacker
  • allows the database to
  • distinguish
  • between
  • data,
  • code a
  • Defense Option 3: Escaping All User Supplied Input
kuni katsuya

How To Configure Java EE 6+ Applications ...Without XML : Adam Bien's Weblog - 0 views

  • How To Configure Java EE 6+ Applications ...Without XML
  • with @Inject:
  • See also page 98 "Configuration Over Convention with Inversion of Control" in Real World Java EE Night Hacks--Dissecting the Business Tier.]
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

Around the World in Java: Deconstructing Spring myths - 0 views

  • the glory of Spring's founding myth of killing the beast that was J2EE seems to be fading. The former beast is now as manageable and easy to use as Spring ever was, or even more so
  • Deconstructing Spring myths
  • looking at the capabilities of the Spring Framework itself, where are the killer features?
  • ...4 more annotations...
  • list of reasons why I feel more productive on Java EE 6 than on Spring 3.1
  • these days there's really no reason for preferring vendor-specific APIs over JPA 2.0
  • Spring and Java EE applications mostly differ in the following areas only: the web framework (Spring MVC vs. JSF vs. Wicket vs. Vaadin vs. Struts vs.....) Spring Beans vs. EJB Spring Dependency Injection vs. CDI or Java EE 5 @EJB or @Resource injection
  • Spring MVC feels rather old-school
kuni katsuya

Part 3 of dependency injection in Java EE 6 - 1 views

  • powerful way of formalizing the recurring bean roles that often arise as a result of application architectural patterns
kuni katsuya

Shiro User - Shiro in CDI/JPA2/JSF2 project - 1 views

  • CDI, JPA2 and JSF2
  • Apache Shiro
  • JpaRealm
  • ...10 more annotations...
  • Entity Beans in combination with an EntityManager
  • use CDI to inject the EntityManager into my JpaRealm
  • JpaRealm is not container managed but is instantiated by Shiro
  • delegate your JpaRealm into @Stateless EJB, which can @Inject EntityManager
  • JpaRealm
  • @PersistenceContext   private EntityManager entityManager;
  • EnvironmentLoaderListener
  • found the cause
  • Instead of configuring the ShiroFilter in my web.xml I had the IniShiroFilter configured. The IniShiroFilter creates a new SecurityManager from the ini file. This new SecurityManager didn't know about the realm I've added in my EnvironmentLoader, so it didn't have any realms.
  • I replaced it with the ShiroFilter in my web.xml and all seems to be working now with my CdiEnvironmentLoaderListener.
kuni katsuya

Chapter 10. Integration with CDI - 0 views

  • Chapter 10. Integration with CDI
  • GraniteDS provides out-of-the-box integration with CDI via the Tide API
  • GraniteDS also integrates with container security for authentication and role-based authorization
  • ...37 more annotations...
  • always have to include this library in either WEB-INF/lib
  • support for CDI is included in the library granite-cdi.jar
  • 10.1. Configuration with Servlet 3 On Servlet 3 compliant containers, GraniteDS can use the new APIs to automatically register its own servlets and filters and thus does not need any particular configuration in web.xml. This automatic setup is triggered when GraniteDS finds a class annotated with @FlexFilter in one of the application archives:
  • @FlexFilter(configProvider=CDIConfigProvider.class) public class GraniteConfig { }  
  • list of annotation names that enable remote access to CDI beans
  • ConfigProvider
  • override these values by setting them in the annotation properties
  • tide=true,         type="cdi",         factoryClass=CDIServiceFactory.class,         tideInterfaces={Identity.class}
  • @FlexFilter declaration will setup an AMF processor for the specified url pattern
  • tideAnnotations
  • defines suitable default values
  • @TideEnabled
  • @RemoteDestination
  • always declared by default
  • tideInterfaces
  • tideRoles
  • exceptionConverters
  • amf3MessageInterceptor
  • 10.3.2. Typesafe Remoting with Dependency Injection
  • It is possible to benefit from even more type safety by using the annotation [Inject] instead of In. When using this annotation, the full class name is used to find the target bean in the CDI context instead of the bean name.
  • Security
  • integration between the client RemoteObject credentials and the server-side container security
  • client-side component named
  • identity
  • API to define runtime authorization checks on the Flex UI
  • login()
  • logout()
  • login(username, password, loginResult, loginFault)
  • logout()
  • bindable property
  • represents the current authentication state
  • loggedIn
  • identity.loggedIn 
  • integrated with server-side role-based security
  • identity.hasRole('admin')
  • clear the security cache manually with
  • identity.clearSecurityCache()
kuni katsuya

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

  • EJB beans cannot be directly exposed to JSF or JSP without a little help from CDI
  • CDI doesn't provide any transactional, monitoring, or concurrency aspect out of the box
  • stateless EJB 3.1 bean as boundary (Facade)
  • ...1 more annotation...
  • injected managed beans (controls) results in the simplest possible architecture
kuni katsuya

tiainen: Easy OAuth using DaliCore and Glassfish: the service provider - 0 views

  • Easy OAuth using DaliCore and Glassfish: the service provider
  • CDI configuration
  • use CDI to inject a reference to the UserBean and the OAuthBean
  • ...2 more annotations...
  • JPA configuration
  • dalicore-oauth persistently stores its request and access tokens, its users and its list of service consumers
kuni katsuya

Needle - Effective Unit Testing for Java EE - Overview - 0 views

  • Test Java EE applications effectively
  • Needle is a lightweight framework for testing Java EE components
  • outside of the container in isolation
  • ...3 more annotations...
  • reduces the test setup code by
  • analysing dependencies
  • automatic injection of mock objects
kuni katsuya

From Spring to Java EE 6 - Java Code Geeks - 1 views

  • prototyped application was designed as a standalone pure Spring applicatio
  • Spring v3
  • analyzed the interest of switching to a Java EE 6
  • ...9 more annotations...
  • can we do in Java EE 6 everything we can do in Spring ? can we do that as easy as in Spring ?
  • yes we can !
  • I am still - a real Spring fanboy (which I, historically speaking, discovered after having been literally disgusted by EJB's 1.0)
  • Contexts & Dependency Injection Messaging Transaction management Web services
  • Spring has an outstanding JMS support
  • Conclusion
  • Arguing that things are in Spring much simpler, much lighter than in Java EE is not - more exactly, no more – true
  • booting really fast
  • From Spring to Java EE 6
kuni katsuya

Chapter 14. Tide client framework - 0 views

‹ Previous 21 - 40 of 54 Next ›
Showing 20 items per page